def run_job_sync(self, fqdn, cmd, args, timeout=None): client = LocalClient(config.get('cthulhu', 'salt_config_path')) results = client.cmd(fqdn, cmd, args, timeout=timeout) if results: if isinstance(fqdn, list): return results else: return results[fqdn] else: raise Unavailable()
def get_server_log(self, fqdn, log_path, lines): client = LocalClient(config.get('cthulhu', 'salt_config_path')) results = client.cmd(fqdn, "log_tail.tail", [log_path, lines]) return results
def list_server_logs(self, fqdn): client = LocalClient(config.get('cthulhu', 'salt_config_path')) results = client.cmd(fqdn, "log_tail.list_logs", ["."]) log.debug('list_server_log result !!! {results}'.format(results=str(results))) return results
def list_server_logs(self, fqdn): client = LocalClient(config.get('cthulhu', 'salt_config_path')) results = client.cmd(fqdn, "log_tail.list_logs", ["."]) log.debug('list_server_log result !!! {results}'.format( results=str(results))) return results
def _run_by_salt(tgt, fun, cmd): client = LocalClient(SALT_CONFIG_PATH) return client.cmd(tgt, fun, cmd, timeout=5)