Exemplo n.º 1
0
 def drop_all_test_databases(self):
     """
     drop all te
     sts databases with prefix
     """
     myfab = FabricSupport(host=self.sth_host, user=self.fabric_user, password=self.fabric_password, cert_file=self.fabric_cert_file, retry=self.fabric_error_retry, hide=True, sudo=self.fabric_sudo)
     myfab.run("sh drop_database_mongo.sh sth_test", path="%s/%s" % (self.fabric_target_path, u'resources'), sudo=False)
Exemplo n.º 2
0
 def sth_service(self, operation):
     """
     cygnus service (status | stop | start | restart)
     :param operation:
     """
     myfab = FabricSupport(host=self.sth_host, user=self.fabric_user, password=self.fabric_password, cert_file=self.fabric_cert_file, retry=self.fabric_error_retry, hide=True, sudo=self.fabric_sudo)
     if self.sth_host != "localhost" and self.sth_host != "127.0.0.1":
         myfab.run("sudo service sth %s" % operation, path=self.fabric_target_path, sudo=False)
Exemplo n.º 3
0
 def sth_service(self, operation):
     """
     cygnus service (status | stop | start | restart)
     :param operation:
     """
     myfab = FabricSupport(
         host=self.sth_host,
         user=self.fabric_user,
         password=self.fabric_password,
         cert_file=self.fabric_cert_file,
         retry=self.fabric_error_retry,
         hide=False,
         sudo=self.fabric_sudo,
     )
     myfab.run("HOST=0.0.0.0 npm start", path=self.fabric_target_path, sudo=False)
Exemplo n.º 4
0
 def drop_all_test_databases(self):
     """
     drop all te
     sts databases with prefix
     """
     myfab = FabricSupport(host=self.sth_host,
                           user=self.fabric_user,
                           password=self.fabric_password,
                           cert_file=self.fabric_cert_file,
                           retry=self.fabric_error_retry,
                           hide=True,
                           sudo=self.fabric_sudo)
     myfab.run("sh drop_database_mongo.sh sth_test",
               path="%s/%s" % (self.fabric_target_path, u'resources'),
               sudo=False)
Exemplo n.º 5
0
 def sth_service(self, operation):
     """
     cygnus service (status | stop | start | restart)
     :param operation:
     """
     myfab = FabricSupport(host=self.sth_host,
                           user=self.fabric_user,
                           password=self.fabric_password,
                           cert_file=self.fabric_cert_file,
                           retry=self.fabric_error_retry,
                           hide=True,
                           sudo=self.fabric_sudo)
     if self.sth_host != "localhost" and self.sth_host != "127.0.0.1":
         myfab.run("sudo service sth %s" % operation,
                   path=self.fabric_target_path,
                   sudo=False)
Exemplo n.º 6
0
 def get_timestamp_remote(self):
     """
     return date-time in timestamp from sth server
     :return float
     """
     myfab = FabricSupport(host=self.sth_host, user=self.fabric_user, password=self.fabric_password, cert_file=self.fabric_cert_file, retry=self.fabric_error_retry, hide=True, sudo=self.fabric_sudo)
     return float(myfab.run("date +%s"))  # get timestamp
Exemplo n.º 7
0
 def get_timestamp_remote(self):
     """
     return date-time in timestamp from sth server
     :return float
     """
     myfab = FabricSupport(host=self.sth_host,
                           user=self.fabric_user,
                           password=self.fabric_password,
                           cert_file=self.fabric_cert_file,
                           retry=self.fabric_error_retry,
                           hide=True,
                           sudo=self.fabric_sudo)
     return float(myfab.run("date +%s"))  # get timestamp