-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Matthias Büchse <[email protected]>
- Loading branch information
Showing
4 changed files
with
42 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,22 +4,6 @@ | |
"""Flavor naming checker | ||
https://github.com/SovereignCloudStack/standards/Test/iaas/flavor-naming/ | ||
Return codes: | ||
0: Matching | ||
1: No SCS flavor | ||
10-19: Error in CPU:Ram spec | ||
20-29: Error in Disk spec | ||
30-39: Error in Hype spec | ||
40-49: Error in optional -hwv support | ||
50-59: Error in optional specific CPU description | ||
60-69: Error in optional GPU spec | ||
70-79: Unknown extension | ||
When checking a list of flavors for completeness with respect | ||
to mandatory flavors, we disregard non-scs flavors (code 1 above) | ||
and only report the number of missing flavors or -- if none was found -- | ||
the sum of parsing errors (>=10) according to above scheme. | ||
(c) Kurt Garloff <[email protected]>, 5/2021 | ||
(c) Matthias Büchse <[email protected]>, 1/2024 | ||
License: CC-BY-SA 4.0 | ||
|
@@ -34,7 +18,7 @@ | |
def usage(): | ||
"help" | ||
print("Usage: flavor-name-check.py [-d] [-v] [-2] [-1] [-o] [-c] [-C mand.yaml] [-i | NAME [NAME [...]]]") | ||
print("Flavor name checker returns 0 if no error, 1 for non SCS flavors and 10+ for wrong flavor names") | ||
print("Flavor name checker returns 0 if no error, otherwise check stderr for details") | ||
print("-d enables debug mode, -v outputs a verbose description, -i enters interactive input mode") | ||
print("-2 disallows old v1 flavor naming, -1 checks old names for completeness, -o accepts them still") | ||
print("-c checks the SCS names AND checks the list for completeness w.r.t. SCS mandatory flavors.") | ||
|
@@ -66,8 +50,8 @@ def input_component(self, targetcls): | |
tbl = attr.get_tbl(target) | ||
if tbl: | ||
print(f" {fdesc} Options:") | ||
for key in tbl.keys(): | ||
print(f" {key}: {tbl[key]}") | ||
for key, v in tbl.items(): | ||
print(f" {key}: {v}") | ||
while True: | ||
print(f" {fdesc}: ", end="") | ||
val = input() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ | |
provided by openstack, such as the number of vCPUs and memory. | ||
(c) Kurt Garloff <[email protected]>, 12/2022 | ||
(c) Matthias Büchse <[email protected]>, 1/2024 | ||
SPDX-License-Identifier: CC-BY-SA 4.0 | ||
""" | ||
|
||
|
@@ -24,8 +25,6 @@ | |
|
||
import flavor_name_check | ||
|
||
fnmck = flavor_name_check.CompatLayer() | ||
|
||
|
||
def usage(rcode=1): | ||
"help output" | ||
|
@@ -44,10 +43,9 @@ def usage(rcode=1): | |
|
||
|
||
def main(argv): | ||
"Entry point -- main loop going over flavors" | ||
"""Entry point -- main loop going over flavors""" | ||
fnmck = flavor_name_check.CompatLayer() | ||
cloud = None | ||
verbose = False | ||
quiet = False | ||
v3mode = False | ||
accept_old_mand = False | ||
scsMandFile = fnmck.mandFlavorFile | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters