Example #1
0
 def do_reapply(self, context, node_id, token=None):
     try:
         data = process.get_introspection_data(node_id, processed=False,
                                               get_json=True)
     except utils.IntrospectionDataStoreDisabled:
         raise utils.Error(_('Inspector is not configured to store '
                             'data. Set the [processing]store_data '
                             'configuration option to change this.'),
                           code=400)
     process.reapply(node_id, data)
Example #2
0
def api_introspection_data(node_id):
    try:
        if not uuidutils.is_uuid_like(node_id):
            node = ir_utils.get_node(node_id, fields=['uuid'])
            node_id = node.uuid
        res = process.get_introspection_data(node_id)
        return res, 200, {'Content-Type': 'application/json'}
    except utils.IntrospectionDataStoreDisabled:
        return error_response(_('Inspector is not configured to store data. '
                                'Set the [processing]store_data '
                                'configuration option to change this.'),
                              code=404)
Example #3
0
    def do_reapply(self, context, node_uuid, token=None, data=None):
        if not data:
            try:
                data = process.get_introspection_data(node_uuid,
                                                      processed=False,
                                                      get_json=True)
            except utils.IntrospectionDataStoreDisabled:
                raise utils.Error(_('Inspector is not configured to store '
                                    'introspection data. Set the '
                                    '[processing]store_data configuration '
                                    'option to change this.'))
        else:
            process.store_introspection_data(node_uuid, data, processed=False)

        process.reapply(node_uuid, data=data)
Example #4
0
    def do_reapply(self, context, node_uuid, token=None, data=None):
        if not data:
            try:
                data = process.get_introspection_data(node_uuid,
                                                      processed=False,
                                                      get_json=True)
            except utils.IntrospectionDataStoreDisabled:
                raise utils.Error(
                    _('Inspector is not configured to store '
                      'introspection data. Set the '
                      '[processing]store_data configuration '
                      'option to change this.'))
        else:
            process.store_introspection_data(node_uuid, data, processed=False)

        process.reapply(node_uuid, data=data)