Exemple #1
0
 def get(self, hostname):
     result = common.getHostnameInfo(hostname)
     if result:
         ansiblevars = [host["vars"] for host in result]
         data = {"vars": ansiblevars}
     else:
         data = {"vars": ""}
     return data
Exemple #2
0
 def get(self, hostname):
     result = common.getHostnameInfo(hostname)
     if result:
         ansiblevars = [host["vars"] for host in result]
         data = {"vars": ansiblevars}
     else:
         data = {"vars": ""}
     return data
Exemple #3
0
 def get_hostinfo(self, hostname):
     result = common.getHostnameInfo(hostname)
     host = [item for item in result]
     if len(hostname) == 0:
         return None
     elif not host:
         return None
     elif host[0]["vars"] == None:
         return None
     else:
         for item in host:
             print item
             ansiblevars = item["vars"]
         return ansiblevars
Exemple #4
0
 def get_hostinfo(self, hostname):
     result = common.getHostnameInfo(hostname)
     host = [item for item in result]
     if len(hostname) == 0:
         return None
     elif not host:
         return None
     elif host[0]["vars"] == None:
         return None
     else:
         for item in host:
             print item
             ansiblevars = item["vars"]
         return ansiblevars