Esempio n. 1
0
 def is_running_in_db(self):
     server = _db_select_query(name=self.name,
                               provider=self.provider,
                               feed=self.feed).first()
     if not server:
         raise MiddlewareServerNotFound(
             "Server '{}' not found in DB!".format(self.name))
     return parse_properties(server.properties)['Server State'] == 'running'
Esempio n. 2
0
 def is_suspended(self):
     server = _db_select_query(name=self.name,
                               provider=self.provider,
                               feed=self.feed).first()
     if not server:
         raise MiddlewareServerNotFound(
             "Server '{}' not found in DB!".format(self.name))
     return parse_properties(
         server.properties)['Suspend State'] == 'SUSPENDED'
Esempio n. 3
0
 def is_running_in_mgmt(self):
     db_srv = _db_select_query(name=self.name,
                               provider=self.provider,
                               feed=self.feed).first()
     if db_srv:
         path = CanonicalPath(db_srv.ems_ref)
         mgmt_srv = self.provider.mgmt.get_config_data(
             feed_id=path.feed_id, resource_id=path.resource_id)
         if mgmt_srv:
             return mgmt_srv.value['Server State'] == 'running'
     raise MiddlewareServerNotFound("Server '{}' not found in MGMT!".format(
         self.name))
Esempio n. 4
0
 def step(self, *args, **kwargs):
     try:
         if self.obj.feed:
             # TODO find_row_on_pages change to entities.get_entity()
             row = self.prerequisite_view.entities.paginator.find_row_on_pages(
                 self.prerequisite_view.entities.elements,
                 server_name=self.obj.name, feed=self.obj.feed)
         elif self.obj.hostname:
             row = self.prerequisite_view.entities.paginator.find_row_on_pages(
                 self.prerequisite_view.entities.elements,
                 server_name=self.obj.name, host_name=self.obj.hostname)
         else:
             row = self.prerequisite_view.entities.paginator.find_row_on_pages(
                 self.prerequisite_view.entities.elements, server_name=self.obj.name)
     except NoSuchElementException:
         raise MiddlewareServerNotFound(
             "Server '{}' not found in table".format(self.name))
     row.click()