def hostinfo(): ''' query host info such as uuid,cpu,memory.. and save to db ''' uuid, info = query_dmi() ips = query_ip() info['name'] = run('hostname').stdout update_host(uuid, ips, **info)
def run(self, *args, **kw): uuid, info = self.query_dmi() ips = self.query_ip() info['name'] = run('hostname').stdout update_host(uuid, ips, **info)