示例#1
0
 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()
示例#2
0
 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()
示例#3
0
文件: rpc.py 项目: ivaxer/calamari
 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
示例#4
0
文件: rpc.py 项目: ivaxer/calamari
 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
示例#5
0
 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
示例#6
0
 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
示例#7
0
def _run_by_salt(tgt, fun, cmd):
    client = LocalClient(SALT_CONFIG_PATH)
    return client.cmd(tgt, fun, cmd, timeout=5)