Limit etcd migration to swact actions
Currently the etcd migration will take place whenever upgrade_swact_migration.py is called. Typically this is called during a swact as part of etcd start. However the script can also be called during etcd restart, which occurs as part of activating secured etcd. The solution is to limit the etcd migration to controller-0. This will ensure the action will only be taken during the swact to controller-0. Closes-Bug: 1927508 Signed-off-by: David Sullivan <david.sullivan@windriver.com> Change-Id: I893eeaa7ddb0b600baa051498a30ed737c688151
This commit is contained in:
parent
1399a4bc54
commit
37d348ae6d
@ -10,6 +10,7 @@
|
||||
|
||||
import os
|
||||
import shutil
|
||||
import socket
|
||||
import subprocess
|
||||
import sys
|
||||
import yaml
|
||||
@ -73,6 +74,10 @@ def migrate_etcd_on_swact():
|
||||
UPGRADE_ETCD_FILE)
|
||||
return
|
||||
|
||||
if socket.gethostname() != 'controller-0':
|
||||
LOG.info("Skipping etcd migration, not running on controller-0")
|
||||
return
|
||||
|
||||
with open(UPGRADE_ETCD_FILE, 'r') as f:
|
||||
document = yaml.safe_load(f)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user