MCPcopy Create free account
hub / github.com/apache/cloudstack / get_rule_logs_for_vms

Function get_rule_logs_for_vms

scripts/vm/network/security_group.py:869–887  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

867
868
869def get_rule_logs_for_vms():
870 state = ['running']
871 vms = virshlist(state)
872
873 result = []
874 try:
875 for name in vms:
876 name = name.rstrip()
877 if 1 not in [name.startswith(c) for c in ['r-', 's-', 'v-', 'i-'] ]:
878 continue
879 # Move actions on rebooted vm to java code
880 # network_rules_for_rebooted_vm(name)
881 if name.startswith('i-'):
882 log = get_rule_log_for_vm(name)
883 result.append(log)
884 except:
885 logging.exception("Failed to get rule logs, better luck next time!")
886
887 print(";".join(result))
888
889
890def cleanup_rules_for_dead_vms():

Callers 1

security_group.pyFile · 0.85

Calls 4

virshlistFunction · 0.85
get_rule_log_for_vmFunction · 0.85
appendMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected