Пример #1
0
 def init_class(cls, init_data):
     """
     Initializer for class variables and parent class.
     """
     try:
         logging.debug("PCDevice class init_data: {0}".
                       format(init_data))
         cls._leases_file_name = init_data["leases_file_name"]
         cls._root_partition = init_data["root_partition"]
         cls._service_mode_name = init_data["service_mode"]
         cls._test_mode_name = init_data["test_mode"]
         cls._registered_lease = None
         return Ssh.init() and Scp.init()
     except KeyError as error:
         logging.critical("Error initializing PC Device Class {0}."
                          .format(error))
         return False
Пример #2
0
 def push(self, source, destination, user="******"):
     """
     Deploys a file from the local filesystem to the device (remote).
     """
     return Scp.push(self._registered_lease, source=source,
                     destination=destination, user=user)