diff --git a/config.yaml b/config.yaml index f6e3f0e..1e70325 100644 --- a/config.yaml +++ b/config.yaml @@ -106,6 +106,9 @@ options: type: string description: Keystone admin password # HA configuration settings + swift-hash: + type: string + description: Hash to use across all swift-proxy servers - don't loose vip: type: string description: "Virtual IP to use to front swift-proxy in ha configuration" diff --git a/hooks/swift_utils.py b/hooks/swift_utils.py index 54a2c50..0645c0e 100644 --- a/hooks/swift_utils.py +++ b/hooks/swift_utils.py @@ -105,6 +105,10 @@ def get_swift_hash(): if os.path.isfile(SWIFT_HASH_FILE): with open(SWIFT_HASH_FILE, 'r') as hashfile: swift_hash = hashfile.read().strip() + elif utils.config_get('swift-hash'): + swift_hash = utils.config_get('swift-hash') + with open(SWIFT_HASH_FILE, 'w') as hashfile: + hashfile.write(swift_hash) else: cmd = ['od', '-t', 'x8', '-N', '8', '-A', 'n'] rand = open('/dev/random', 'r')