summaryrefslogtreecommitdiffstats
path: root/deploy/prepare
diff options
context:
space:
mode:
authorSerenaFeng <feng.xiaowei@zte.com.cn>2017-03-15 14:31:36 +0800
committerSerenaFeng <feng.xiaowei@zte.com.cn>2017-03-15 15:55:09 +0800
commite62117170f9dd562cdb85bf6bd95644655e046c2 (patch)
tree05a4e983534f1687f6d7b96b805eae7130bd08ed /deploy/prepare
parentc557362eb2a14055587feac228a4463bd96f6f4a (diff)
add default_floating_pool configuration for nova-api
Change-Id: I9db5509667e9c10a9c07b55531c6d78fb95cc223 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'deploy/prepare')
-rw-r--r--deploy/prepare/__init__.py0
-rw-r--r--deploy/prepare/execute.py32
2 files changed, 32 insertions, 0 deletions
diff --git a/deploy/prepare/__init__.py b/deploy/prepare/__init__.py
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/deploy/prepare/__init__.py
diff --git a/deploy/prepare/execute.py b/deploy/prepare/execute.py
new file mode 100644
index 00000000..a50d9d9a
--- /dev/null
+++ b/deploy/prepare/execute.py
@@ -0,0 +1,32 @@
+import argparse
+import os
+
+from deploy.config.network import NetworkConfig
+
+NOVA_CONF_PATH = '/etc/kolla/config/nova'
+NOVA_API_CONF = '{}/nova-api.conf'.format(NOVA_CONF_PATH)
+
+
+def _config_nova_api(network_file):
+ xnet = NetworkConfig(network_file=network_file).external_network
+ if not os.path.isdir(NOVA_CONF_PATH):
+ os.makedirs(NOVA_CONF_PATH, mode=0644)
+
+ with open(NOVA_API_CONF, 'w') as f:
+ f.write('[DEFAULT]\n'
+ 'default_floating_pool={}\n'.format(xnet['network_name']))
+ f.close()
+
+
+def main():
+ parser = argparse.ArgumentParser()
+ parser.add_argument('-nw', '--network-file',
+ type=str,
+ required=True,
+ help='network configuration file')
+ args = parser.parse_args()
+ _config_nova_api(args.network_file)
+
+
+if __name__ == '__main__':
+ main()