diff options
author | Szilard Cserey <szilard.cserey@ericsson.com> | 2015-11-10 22:14:22 +0100 |
---|---|---|
committer | Szilard Cserey <szilard.cserey@ericsson.com> | 2015-11-12 21:00:18 +0100 |
commit | 27c12b01000ddaa12a57b3383c717fac65417db4 (patch) | |
tree | 66c451470afc908b3580c60d4096d44857fb9398 | |
parent | 6794ccd3a7fc05db0609c74510a9c8c123630ec1 (diff) |
FIX for NTP and for error log fetching from nodes
Change-Id: I2d56ccc97216676f5bf01b7ea1b35aaade9c33da
Signed-off-by: Szilard Cserey <szilard.cserey@ericsson.com>
3 files changed, 19 insertions, 12 deletions
diff --git a/fuel/deploy/cloud/deployment.py b/fuel/deploy/cloud/deployment.py index a294be545..12c1f8978 100644 --- a/fuel/deploy/cloud/deployment.py +++ b/fuel/deploy/cloud/deployment.py @@ -26,6 +26,7 @@ SEARCH_TEXT = 'Puppet (err)' LOG_FILE = '/var/log/puppet.log' GREP_LINES_OF_LEADING_CONTEXT = 100 GREP_LINES_OF_TRAILING_CONTEXT = 100 +LIST_OF_CHAR_TO_BE_ESCAPED = ['[', ']', '"'] class Deployment(object): @@ -47,9 +48,14 @@ class Deployment(object): results, _ = exec_cmd(cmd, False) for result in results.splitlines(): log_msg = '' - cmd = ('ssh -q node-%s "grep -B%s \\"%s\\" %s"' - % (node_id, GREP_LINES_OF_LEADING_CONTEXT, result, - LOG_FILE)) + + sub_cmd = '"%s" %s' % (result, LOG_FILE) + for c in LIST_OF_CHAR_TO_BE_ESCAPED: + sub_cmd = sub_cmd.replace(c, '\%s' % c) + grep_cmd = ('grep -B%s %s' + % (GREP_LINES_OF_LEADING_CONTEXT, sub_cmd)) + cmd = ('ssh -q node-%s "%s"' % (node_id, grep_cmd)) + details, _ = exec_cmd(cmd, False) details_list = details.splitlines() @@ -61,9 +67,10 @@ class Deployment(object): if found_prev_log: log_msg += '\n'.join(details_list[i:-1]) + '\n' - cmd = ('ssh -q node-%s "grep -A%s \\"%s\\" %s"' - % (node_id, GREP_LINES_OF_TRAILING_CONTEXT, result, - LOG_FILE)) + grep_cmd = ('grep -A%s %s' + % (GREP_LINES_OF_TRAILING_CONTEXT, sub_cmd)) + cmd = ('ssh -q node-%s "%s"' % (node_id, grep_cmd)) + details, _ = exec_cmd(cmd, False) details_list = details.splitlines() diff --git a/fuel/deploy/templates/hardware_environment/conf/ericsson_montreal_lab/dea.yaml b/fuel/deploy/templates/hardware_environment/conf/ericsson_montreal_lab/dea.yaml index 67fba4f66..30851ea43 100644 --- a/fuel/deploy/templates/hardware_environment/conf/ericsson_montreal_lab/dea.yaml +++ b/fuel/deploy/templates/hardware_environment/conf/ericsson_montreal_lab/dea.yaml @@ -46,8 +46,8 @@ fuel: user: admin password: admin HOSTNAME: opnfv - NTP1: 10.118.34.219 - NTP2: + NTP1: 10.118.32.193 + NTP2: 10.118.34.193 NTP3: interfaces_1: eth0: @@ -488,7 +488,7 @@ settings: error: Invalid NTP server list source: ^\s*(?:(?:\w+(?:-+\w+)*\.)+[a-z]+|\d{1,3}(?:\.\d{1,3}){3})\s*(?:,\s*(?:(?:\w+(?:-+\w+)*\.)+[a-z]+|\d{1,3}(\.\d{1,3}){3})\s*)*$ type: text - value: 10.118.34.219 + value: 110.118.32.193, 10.118.34.193 weight: 10 kernel_params: kernel: diff --git a/fuel/deploy/templates/virtual_environment/conf/dea.yaml b/fuel/deploy/templates/virtual_environment/conf/dea.yaml index 8db0ccd57..84efe55f6 100644 --- a/fuel/deploy/templates/virtual_environment/conf/dea.yaml +++ b/fuel/deploy/templates/virtual_environment/conf/dea.yaml @@ -38,8 +38,8 @@ fuel: user: admin password: admin HOSTNAME: opnfv_virt - NTP1: 10.118.34.219 - NTP2: + NTP1: 10.118.32.193 + NTP2: 10.118.34.193 NTP3: interfaces_1: eth0: @@ -482,7 +482,7 @@ settings: error: Invalid NTP server list source: ^\s*(?:(?:\w+(?:-+\w+)*\.)+[a-z]+|\d{1,3}(?:\.\d{1,3}){3})\s*(?:,\s*(?:(?:\w+(?:-+\w+)*\.)+[a-z]+|\d{1,3}(\.\d{1,3}){3})\s*)*$ type: text - value: 10.118.34.219 + value: 110.118.32.193, 10.118.34.193 weight: 10 kernel_params: kernel: |