コード例 #1
0
ファイル: api.py プロジェクト: saintifly/Server_Manage_Plugin
 def unregister_conductor(self, hostname):
     with _session_for_write():
         query = (model_query(models.Conductor).filter_by(hostname=hostname,
                                                          online=True))
         count = query.update({'online': False})
         if count == 0:
             raise exception.ConductorNotFound(conductor=hostname)
コード例 #2
0
ファイル: api.py プロジェクト: zaletniy/ironic
 def get_conductor(self, hostname):
     try:
         return model_query(models.Conductor).\
                         filter_by(hostname=hostname).\
                         one()
     except NoResultFound:
         raise exception.ConductorNotFound(conductor=hostname)
コード例 #3
0
ファイル: api.py プロジェクト: zaletniy/ironic
 def unregister_conductor(self, hostname):
     session = get_session()
     with session.begin():
         query = model_query(models.Conductor, session=session).\
                     filter_by(hostname=hostname)
         count = query.delete()
         if count == 0:
             raise exception.ConductorNotFound(conductor=hostname)
コード例 #4
0
ファイル: api.py プロジェクト: erhan-ekici/ironic
 def unregister_conductor(self, hostname):
     session = get_session()
     with session.begin():
         query = (model_query(models.Conductor, session=session)
                  .filter_by(hostname=hostname, online=True))
         count = query.update({'online': False})
         if count == 0:
             raise exception.ConductorNotFound(conductor=hostname)
コード例 #5
0
ファイル: api.py プロジェクト: zaletniy/ironic
 def touch_conductor(self, hostname):
     session = get_session()
     with session.begin():
         query = model_query(models.Conductor, session=session).\
                     filter_by(hostname=hostname)
         # since we're not changing any other field, manually set updated_at
         count = query.update({'updated_at': timeutils.utcnow()})
         if count == 0:
             raise exception.ConductorNotFound(conductor=hostname)
コード例 #6
0
ファイル: api.py プロジェクト: jangseon-ryu/ironic
 def touch_conductor(self, hostname):
     with _session_for_write():
         query = (model_query(models.Conductor)
                  .filter_by(hostname=hostname))
         # since we're not changing any other field, manually set updated_at
         # and since we're heartbeating, make sure that online=True
         count = query.update({'updated_at': timeutils.utcnow(),
                               'online': True})
         if count == 0:
             raise exception.ConductorNotFound(conductor=hostname)