summaryrefslogtreecommitdiffstats
path: root/lib/python/apex/common
diff options
context:
space:
mode:
authorTim Rozet <trozet@redhat.com>2016-05-31 17:40:11 -0400
committerTim Rozet <trozet@redhat.com>2016-06-02 21:04:40 -0400
commit68fc16c4fc98d26bbb58cda6ce7945c2ac6d79bc (patch)
treed2eb7f5ccf29f66e58c7cf2b1c3575c52604adb7 /lib/python/apex/common
parent46a44b6c0789b32e84a6166f913b2c9a61e29cc3 (diff)
Migrates network environment parsing to python
Change-Id: Ibaf20a2960a9f4b5e3f256fbed12a61d7606a967 Signed-off-by: Tim Rozet <trozet@redhat.com>
Diffstat (limited to 'lib/python/apex/common')
-rw-r--r--lib/python/apex/common/__init__.py0
-rw-r--r--lib/python/apex/common/constants.py16
-rw-r--r--lib/python/apex/common/utils.py15
3 files changed, 31 insertions, 0 deletions
diff --git a/lib/python/apex/common/__init__.py b/lib/python/apex/common/__init__.py
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/lib/python/apex/common/__init__.py
diff --git a/lib/python/apex/common/constants.py b/lib/python/apex/common/constants.py
new file mode 100644
index 00000000..506b7b2b
--- /dev/null
+++ b/lib/python/apex/common/constants.py
@@ -0,0 +1,16 @@
+##############################################################################
+# Copyright (c) 2016 Tim Rozet (trozet@redhat.com) and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+ADMIN_NETWORK = 'admin_network'
+PRIVATE_NETWORK = 'private_network'
+PUBLIC_NETWORK = 'public_network'
+STORAGE_NETWORK = 'storage_network'
+API_NETWORK = 'api_network'
+OPNFV_NETWORK_TYPES = [ADMIN_NETWORK, PRIVATE_NETWORK, PUBLIC_NETWORK,
+ STORAGE_NETWORK, API_NETWORK]
diff --git a/lib/python/apex/common/utils.py b/lib/python/apex/common/utils.py
new file mode 100644
index 00000000..b7678a20
--- /dev/null
+++ b/lib/python/apex/common/utils.py
@@ -0,0 +1,15 @@
+##############################################################################
+# Copyright (c) 2016 Tim Rozet (trozet@redhat.com) and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+
+def str2bool(var):
+ if isinstance(var, bool):
+ return var
+ else:
+ return var.lower() in ("true", "yes")