summaryrefslogtreecommitdiffstats
path: root/lib/python/apex/common/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/python/apex/common/utils.py')
-rw-r--r--lib/python/apex/common/utils.py15
1 files changed, 15 insertions, 0 deletions
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")