Beispiel #1
0
 def refresh_all(self):
     """
     Reconfigure all zones
     """
     self._begin_op()
     db_session = self.db_session
     id_query = db_session.query(ZoneSM.id_, ZoneSM.name)
     id_query = ZoneSM.query_is_configured(id_query)
     id_result = id_query.all()
     for zone_id, zone_name in id_result:
         try:
             zone_sm = db_session.query(ZoneSM)\
                     .filter(ZoneSM.id_ == zone_id).one()
         except NoResultFound:
             raise ZoneNotFoundByZoneId(zone_id)
         exec_zonesm(zone_sm, ZoneSMDoRefresh)
     self._finish_op()
Beispiel #2
0
 def refresh_sg(self, sg_name):
     """
     Refresh all zones on an SG
     """
     self._begin_op()
     db_session = self.db_session
     sg = self._find_sg_byname(sg_name)
     id_query = db_session.query(ZoneSM.id_, ZoneSM.name)\
             .filter(ZoneSM.sg_id == sg.id_) 
     id_query = ZoneSM.query_is_configured(id_query)
     id_result = id_query.all()
     for zone_id, zone_name in id_result:
         try:
             zone_sm = db_session.query(ZoneSM)\
                     .filter(ZoneSM.id_ == zone_id).one()
         except NoResultFound:
             raise ZoneNotFoundByZoneId(zone_id)
         exec_zonesm(zone_sm, ZoneSMDoRefresh)
     self._finish_op()