Skip to content

Commit a2748eb

Browse files
committed
Bugfix: image-md-check.py too lenient, scs-0102-v1 too strict
resolves #913 Signed-off-by: Matthias Büchse <[email protected]>
1 parent fd0d2c5 commit a2748eb

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

Standards/scs-0102-v1-image-metadata.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,20 @@ in the [OpenStack Image documentation](https://docs.openstack.org/glance/latest/
5252

5353
The following properties are considered mandatory:
5454

55-
- `architecture`, `hypervisor_type`
55+
- `architecture`
5656
- `min_disk` (in GiB), `min_ram` (in MiB)
5757
- `os_version`, `os_distro`
58-
- `hw_rng_model`, `hw_disk_bus` (`scsi` recommended, and then setting `hw_scsi_model` is also recommended)
58+
- `hw_disk_bus` (`scsi` recommended, and then setting `hw_scsi_model` is also recommended)
5959

6060
**Note**: Disk sizes tend to be measured in GB = 10^9 and not GiB = 2^30 in the disk industry, but OpenStack uses GiB.
6161

62-
The following properties are recommended (if the features are supported):
62+
The following property is recommended:
6363

64+
- `hypervisor_type`
65+
66+
The following further properties are recommended (if the features are supported):
67+
68+
- `hw_rng_model`
6469
- `os_secure_boot`, `hw_firmware_type`
6570
- `hw_watchdog_action`, `hw_mem_encryption`, `hw_pmu`, `hw_video_ram`, `hw_vif_multiqueue_enabled`
6671

Tests/iaas/image-metadata/image-md-check.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,12 +282,17 @@ def validate_imageMD(img, outd_list):
282282
if img.min_ram < 64:
283283
print(f'WARNING: Image "{imgnm}": min_ram == {img.min_ram} MiB < 64 MiB', file=sys.stderr)
284284
warnings += 1
285-
# errors += 1
285+
if not img.min_ram:
286+
print(f'ERROR: Image "{imgnm}": min_ram == 0', file=sys.stderr)
287+
errors += 1
286288
if img.min_disk * GIB < img.size:
287289
print(f'WARNING: Image "{imgnm}": img size == {img.size / MIB:.0f} MiB, but min_disk == {img.min_disk * GIB / MIB:.0f} MiB',
288290
file=sys.stderr)
289291
warnings += 1
290-
# errors += 1
292+
if not img.min_disk:
293+
print(f'WARNING: Image "{imgnm}": min_disk == 0',
294+
file=sys.stderr)
295+
errors += 1
291296
# (6) tags os:*, managed_by_*
292297
# Nothing to do here ... we could do a warning if those are missing ...
293298

0 commit comments

Comments
 (0)