Ejemplo n.º 1
0
 def find_status_by_server(self, serial_no=None):
     if serial_no is not None and serial_no != "":
         s = Servers(self._rpcurl)
         server_rec = s.find_by_serial_no(serial_no)
         if server_rec is not None:
             installstate = self._proxy.dc2.deployment.installstate.get(
                 {"server_id": server_rec["_id"]})
             if installstate is not None:
                 return installstate
     return None
Ejemplo n.º 2
0
Archivo: hosts.py Proyecto: sadig/DC2
 def find_by_server_serial(self, serial_no=None):
     if serial_no is not None:
         s = Servers(self._rpcurl)
         server_rec = s.find_by_serial_no(serial_no)
         if server_rec is not None:
             host_list = self._proxy.dc2.inventory.hosts.find(
                 {"server_id": server_rec["_id"]})
             if (host_list is not None and
                     len(host_list) > 0 and
                     host_list[0] is not None):
                 return host_list[0]
     return None
Ejemplo n.º 3
0
 def update_status_by_server(
     self,
     serial_no=None,
     status=None,
         progress=None):
     if serial_no is not None and serial_no != "":
         s = Servers(self._rpcurl)
         server_rec = s.find_by_serial_no(serial_no)
         if server_rec is not None:
             installstate = self._proxy.dc2.deployment.installstate.get(
                 {"server_id": server_rec["_id"]})
             if installstate is not None:
                 result = self._update_status(
                     installstate, status, progress)
                 return result
     return None