Skip to content

Commit ef46e2d

Browse files
authored
Add new standards to scs-compatible-iaas-v5 and make scripts executable (#788)
Signed-off-by: Matthias Büchse <[email protected]>
1 parent 4ca42f9 commit ef46e2d

File tree

6 files changed

+194
-192
lines changed

6 files changed

+194
-192
lines changed

Tests/iaas/key-manager/check-for-key-manager.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,15 +127,16 @@ def main():
127127
# parse cloud name for lookup in clouds.yaml
128128
cloud = args.os_cloud or os.environ.get("OS_CLOUD", None)
129129
if not cloud:
130-
raise RuntimeError(
130+
logger.critical(
131131
"You need to have the OS_CLOUD environment variable set to your cloud "
132132
"name or pass it via --os-cloud"
133133
)
134+
return 2
134135

135136
with openstack.connect(cloud=cloud) as conn:
136137
if not check_for_member_role(conn):
137138
logger.critical("Cannot test key-manager permissions. User has wrong roles")
138-
return 1
139+
return 2
139140
if check_presence_of_key_manager(conn):
140141
return check_key_manager_permissions(conn)
141142
else:
@@ -145,9 +146,11 @@ def main():
145146

146147
if __name__ == "__main__":
147148
try:
148-
sys.exit(main())
149-
except SystemExit:
149+
sys.exit(main() or 0)
150+
except SystemExit as e:
151+
if e.code < 2:
152+
print("key-manager-check: " + ('PASS', 'FAIL')[min(1, e.code)])
150153
raise
151154
except BaseException:
152155
logger.critical("exception", exc_info=True)
153-
sys.exit(1)
156+
sys.exit(2)

Tests/iaas/security-groups/default-security-group-rules.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/usr/bin/env python3
12
"""Default Security Group Rules Checker
23
34
This script tests the absence of any ingress default security group rule

0 commit comments

Comments
 (0)