diff options
author | Michael Lando <ml636r@att.com> | 2017-02-19 10:28:42 +0200 |
---|---|---|
committer | Michael Lando <ml636r@att.com> | 2017-02-19 10:51:01 +0200 |
commit | 451a3400b76511393c62a444f588a4ed15f4a549 (patch) | |
tree | e4f5873a863d1d3e55618eab48b83262f874719d /catalog-be/src/main/resources/scripts/import/tosca/importCommon.py | |
parent | 5abfe4e1fb5fae4bbd5fbc340519f52075aff3ff (diff) |
Initial OpenECOMP SDC commit
Change-Id: I0924d5a6ae9cdc161ae17c68d3689a30d10f407b
Signed-off-by: Michael Lando <ml636r@att.com>
Diffstat (limited to 'catalog-be/src/main/resources/scripts/import/tosca/importCommon.py')
-rw-r--r-- | catalog-be/src/main/resources/scripts/import/tosca/importCommon.py | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/catalog-be/src/main/resources/scripts/import/tosca/importCommon.py b/catalog-be/src/main/resources/scripts/import/tosca/importCommon.py new file mode 100644 index 0000000000..acdb067849 --- /dev/null +++ b/catalog-be/src/main/resources/scripts/import/tosca/importCommon.py @@ -0,0 +1,43 @@ +import pycurl +import sys, getopt +from StringIO import StringIO +import json +import copy + +############################################################################################################### +# +# +############################################################################################################### + +debugFlag = True + +def join_strings(lst): + concat = "" + for string in lst: + if (string != None): + if (type(string) == int): + string = str(string) + concat += (string + " ") + return concat + +def debug(desc, *args): + 'print only if debug enabled' + if (debugFlag == True): + print desc, join_strings(args) + +def log(desc, arg=None): + 'print log info' + print desc, arg + +def errorAndExit(errorCode, errorDesc): + if ( errorCode > 0 ): + print "status={0}. {1}".format(errorCode, '' if errorDesc == None else errorDesc) + else: + print "status={0}".format(errorCode) + sys.exit(errorCode) + +def printNameAndReturnCode(name, code): + print "{0:30} | {1:6}".format(name, code) + +def printFrameLine(): + print "----------------------------------------" |