cyborg/objects/extarq.py
def create(self, context, device_profile_id=None):
        """Create an ExtARQ record in the DB."""
        # HACK TODO validate properly
        if 'device_profile_name' not in self:
            raise exception.ObjectActionError(action='create',
                      reason='device profile name is required')

        # db layer will create an UUID if needed
        self.state = 'Initial'

        values = self.obj_get_changes()

        # Pass devprof id to db layer, to avoid repeated queries
        if device_profile_id is not None:
            values['device_profile_id'] = device_profile_id

        db_extarq = self.dbapi.extarq_create(context, values)
        for n in ['host_name', 'device_rp_uuid', 'instance_uuid']:
            # HACK: force these fields to be not None
            if db_extarq[n] is None:
                db_extarq[n] = ''
        self._from_db_object(self, db_extarq)
Create an ExtARQ record in the DB.
Create an ExtARQ record in the DB.
Create an ExtARQ record in the DB .
def create(self, context, device_profile_id=None):
        if 'device_profile_name' not in self:
            raise exception.ObjectActionError(action='create',
                      reason='device profile name is required')
        self.state = 'Initial'
        values = self.obj_get_changes()
        if device_profile_id is not None:
            values['device_profile_id'] = device_profile_id
        db_extarq = self.dbapi.extarq_create(context, values)
        for n in ['host_name', 'device_rp_uuid', 'instance_uuid']:
            if db_extarq[n] is None:
                db_extarq[n] = ''
        self._from_db_object(self, db_extarq)
def create ( self , context , device_profile_id = None ) : if 'device_profile_name' not in self : raise exception . ObjectActionError ( action = 'create' , reason = 'device profile name is required' ) self . state = 'Initial' values = self . obj_get_changes ( ) if device_profile_id is not None : values [ 'device_profile_id' ] = device_profile_id db_extarq = self . dbapi . extarq_create ( context , values ) for n in [ 'host_name' , 'device_rp_uuid' , 'instance_uuid' ] : if db_extarq [ n ] is None : db_extarq [ n ] = '' self . _from_db_object ( self , db_extarq )
Create an ExtARQ record in the DB.
Create an ExtARQ record in the DB .
"""Create an ExtARQ record in the DB.""" # HACK TODO validate properly # db layer will create an UUID if needed # Pass devprof id to db layer, to avoid repeated queries # HACK: force these fields to be not None
self
context
device_profile_id