From e29a4ea1b77bdb9e78e2fabac8a3029c4c2b61fc Mon Sep 17 00:00:00 2001 From: Harry Huang Date: Tue, 4 Dec 2018 11:41:34 +0800 Subject: Adapt compass4nfv scripts to new compass-deck JIRA: COMPASS-612 1. pass machine info through file 2. generate mac address in config_parse.py Change-Id: Iaaf0f2b1f4ab97e8200c8c046746168d991570e3 Signed-off-by: Harry Huang --- util/check_valid.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'util/check_valid.py') diff --git a/util/check_valid.py b/util/check_valid.py index e6a72e71..9348d272 100644 --- a/util/check_valid.py +++ b/util/check_valid.py @@ -98,25 +98,19 @@ def check_dha_file(dha): invalid = False if dha['TYPE'] == 'baremetal': for i in dha['hosts']: - if not is_valid_mac(i['mac']): - err_print('''invalid address: - hosts: - - name: %s - mac: %s''' % (i['name'], i['mac'])) - invalid = True for j in i['interfaces']: - if not is_valid_mac(j.values()[0]): + if not is_valid_mac(i['interfaces'].get(j)): err_print('''invalid address: hosts: - name: %s interfaces: - - %s: %s''' % (i['name'], j.keys()[0], j.values()[0])) # noqa: E501 + - %s: %s''' % (i['name'], j, i['interfaces'].get(j))) # noqa: E501 invalid = True - if not is_valid_ip(i['ipmiIp']): + if not is_valid_ip(i['power_ip']): err_print('''invalid address: hosts: - name: %s - ipmiIp: %s''' % (i['name'], i['ipmiIp'])) + power_ip: %s''' % (i['name'], i['power_ip'])) invalid = True if not invalid: -- cgit 1.2.3-korg