diff options
-rw-r--r-- | app/handlers/common.py | 3 | ||||
-rw-r--r-- | app/models/__init__.py | 1 | ||||
-rw-r--r-- | app/models/boot.py | 2 | ||||
-rw-r--r-- | app/models/tests/test_boot_model.py | 4 | ||||
-rw-r--r-- | app/utils/bootimport.py | 1 | ||||
-rw-r--r-- | app/utils/scripts/convert-models.py | 1 | ||||
-rw-r--r-- | doc/schema-boot.rst | 8 |
7 files changed, 18 insertions, 2 deletions
diff --git a/app/handlers/common.py b/app/handlers/common.py index 17fe5cb..bd53564 100644 --- a/app/handlers/common.py +++ b/app/handlers/common.py @@ -57,6 +57,7 @@ BOOT_VALID_KEYS = { ], models.ACCEPTED_KEYS: [ models.ARCHITECTURE_KEY, + models.BOARD_INSTANCE_KEY, models.BOARD_KEY, models.BOOT_LOAD_ADDR_KEY, models.BOOT_LOG_HTML_KEY, @@ -90,7 +91,7 @@ BOOT_VALID_KEYS = { models.LAB_NAME_KEY, models.NAME_KEY, models.STATUS_KEY, - models.VERSION_KEY, + models.VERSION_KEY ] }, 'GET': [ diff --git a/app/models/__init__.py b/app/models/__init__.py index adcc453..9723ada 100644 --- a/app/models/__init__.py +++ b/app/models/__init__.py @@ -23,6 +23,7 @@ AGGREGATE_KEY = 'aggregate' ARCHITECTURE_KEY = 'arch' ARM64_ARCHITECTURE_KEY = 'arm64' ARM_ARCHITECTURE_KEY = 'arm' +BOARD_INSTANCE_KEY = 'board_instance' BOARD_KEY = 'board' BOOT_ID_KEY = 'boot_id' BOOT_LOAD_ADDR_KEY = 'loadaddr' diff --git a/app/models/boot.py b/app/models/boot.py index 3f4981c..92c3dfc 100644 --- a/app/models/boot.py +++ b/app/models/boot.py @@ -64,6 +64,7 @@ class BootDocument(modb.BaseDocument): self._job = job self._kernel = kernel self._lab_name = lab_name + self.board_instance = None self.boot_log = None self.boot_log_html = None self.boot_result_description = None @@ -186,6 +187,7 @@ class BootDocument(modb.BaseDocument): def to_dict(self): boot_dict = { models.ARCHITECTURE_KEY: self.arch, + models.BOARD_INSTANCE_KEY: self.board_instance, models.BOARD_KEY: self.board, models.BOOT_LOG_HTML_KEY: self.boot_log_html, models.BOOT_LOG_KEY: self.boot_log, diff --git a/app/models/tests/test_boot_model.py b/app/models/tests/test_boot_model.py index 8794ec0..90c12a2 100644 --- a/app/models/tests/test_boot_model.py +++ b/app/models/tests/test_boot_model.py @@ -49,6 +49,7 @@ class TestBootModel(unittest.TestCase): boot_doc.file_server_url = "file-server" boot_doc.file_server_resource = "file-resource" boot_doc.initrd = "initrd" + boot_doc.board_instance = "instance" expected = { '_id': 'id', @@ -87,7 +88,8 @@ class TestBootModel(unittest.TestCase): "defconfig_full": "defconfig", "file_server_url": "file-server", "file_server_resource": "file-resource", - "initrd": "initrd" + "initrd": "initrd", + "board_instance": "instance" } self.assertDictEqual(expected, boot_doc.to_dict()) diff --git a/app/utils/bootimport.py b/app/utils/bootimport.py index 4cfd117..c0a141b 100644 --- a/app/utils/bootimport.py +++ b/app/utils/bootimport.py @@ -303,6 +303,7 @@ def _update_boot_doc_from_json(boot_doc, boot_json, json_pop_f): boot_doc.status = json_pop_f( models.BOOT_RESULT_KEY, models.UNKNOWN_STATUS ) + boot_doc.board_instance = json_pop_f(models.BOARD_INSTANCE_KEY, None) boot_doc.boot_log = json_pop_f(models.BOOT_LOG_KEY, None) boot_doc.boot_log_html = json_pop_f(models.BOOT_LOG_HTML_KEY, None) boot_doc.boot_result_description = json_pop_f( diff --git a/app/utils/scripts/convert-models.py b/app/utils/scripts/convert-models.py index 27756e5..f1ee234 100644 --- a/app/utils/scripts/convert-models.py +++ b/app/utils/scripts/convert-models.py @@ -427,6 +427,7 @@ def convert_boot_collection(db, lab_name, limit=0): arch + "-" + defconfig_full + "/" ) + boot_doc.board_instance = meta_pop("board_instance", None) boot_doc.initrd = meta_pop("initrd", None) boot_doc.file_server_url = meta_pop("file_server_url", None) diff --git a/doc/schema-boot.rst b/doc/schema-boot.rst index 611f108..7d0ff81 100644 --- a/doc/schema-boot.rst +++ b/doc/schema-boot.rst @@ -44,6 +44,10 @@ necessary to use its ``_id`` value. "type": "string", "description": "The name of the board" }, + "board_instance": { + "type": "string", + "description": "The instance identifier for the board" + }, "job": { "type": "string", "description": "The job associated with this object" @@ -236,6 +240,10 @@ have when sent to the server. "type": "string", "description": "The name of the board: it must be a valid and recognized name" }, + "board_instance": { + "type": "string", + "description": "The instance identifier for the board" + }, "arch" : { "type": "string", "description": "The architecture type of this board", |