diff options
Diffstat (limited to 'lib/python/apex/common')
-rw-r--r-- | lib/python/apex/common/__init__.py | 0 | ||||
-rw-r--r-- | lib/python/apex/common/constants.py | 16 | ||||
-rw-r--r-- | lib/python/apex/common/utils.py | 15 |
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") |