def get_private_key(file_path = ""): ssh_key_file = env.get_property("SSH_KEY_PRIVATE") if os.path.isfile(ssh_key_file): return os.path.abspath(ssh_key_file) else: key_file_in_env_foldder = os.path.join(env.path,ssh_key_file) return key_file_in_env_foldder if os.path.isfile(key_file_in_env_foldder) else None
def ssh_command(server, command): """executes command with ssh on remote machine""" ssh_key = get_private_key() ssh_options = env.get_property("SSH_OPTIONS") command = "ssh -i {0} {1} root@{2} '{3}' ".format(ssh_key,ssh_options,server,command) print command
def get_btrfs_subvolume_path(self): return self.get_main().get("tbsubdir",env.get_property('BTRFS_ROOT'))
def get_adm_data_source(self): return self.get_data_sources().get("sourceDirADM", env.get_property("SW_SOURCE_ROOT"))
def get_default_java(self): return self.get_main().get("java",env.get_property('JAVA_HOME'))