Browse Source

Check conntrack backup log in Dom0

When enable conntrack-tools, we will change the conntrackd.conf
file, but there is an error, current code is checking the DomU
to see whether the backup file exist, however this check should
in Dom0, this patch is to fix this problem

Change-Id: Ib9de2a2707785b04b38173e1d3bccadfa11b753e
Huan Xie 2 years ago
parent
commit
dce4954d10
1 changed files with 5 additions and 1 deletions
  1. 5
    1
      plugin_source/deployment_scripts/compute_post_deployment.py

+ 5
- 1
plugin_source/deployment_scripts/compute_post_deployment.py View File

@@ -456,7 +456,11 @@ def check_and_setup_ceilometer(himn, username, password):
456 456
 
457 457
 def enable_conntrack_service(himn, username):
458 458
     # use conntrack statistic mode, so change conntrackd.conf
459
-    if not os.path.exists('/etc/conntrackd/conntrackd.conf.back'):
459
+    errcode, out, err = utils.ssh_detailed(
460
+        himn, username, 'ls', '/etc/conntrackd/conntrackd.conf.back',
461
+        allowed_return_codes=[0, 2])
462
+    if errcode == 2:
463
+        # Only make conntrackd.conf.back if it doesn't exist
460 464
         utils.ssh(himn, username,
461 465
                   'mv',
462 466
                   '/etc/conntrackd/conntrackd.conf',

Loading…
Cancel
Save