Browse Source
Closing #74 Bug/python3 (#87)
* remove excep handler
* update
* change print
* fix for python3
* fix for python3
* python3 changes
master
Gerry Nelson
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with
42 additions and
59 deletions
-
BIN
__pycache__/sharedfunctions.cpython-36.pyc
-
createbinarybackup.py
-
deletepublishdest.py
-
explainaccess.py
-
getpath.py
-
getruleid.py
-
listallcasservercachestatus.py
-
listcaslibs.py
-
listcaslibsandeffectiveaccess.py
-
listcastables.py
-
listcastablesandeffectiveaccess.py
-
listgroupsandmembers.py
-
listmemberswithpath.py
-
testfolderaccess.py
|
|
|
@ -23,6 +23,14 @@ |
|
|
|
# limitations under the License. |
|
|
|
# |
|
|
|
|
|
|
|
# Import Python modules |
|
|
|
|
|
|
|
from sharedfunctions import callrestapi, getapplicationproperties |
|
|
|
import argparse |
|
|
|
import json |
|
|
|
import sys |
|
|
|
import os |
|
|
|
|
|
|
|
# get python version |
|
|
|
version=int(str(sys.version_info[0])) |
|
|
|
|
|
|
|
@ -35,7 +43,6 @@ cliexe=propertylist["sascli.executable"] |
|
|
|
clicommand=os.path.join(clidir,cliexe) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
debug=False |
|
|
|
defaultBackupScheduleName="DEFAULT_BACKUP_SCHEDULE" |
|
|
|
newScheduleName="BINARY_BACKUP_SCHEDULE" |
|
|
|
@ -44,20 +51,12 @@ jobDefinitionURIStem="/jobDefinitions/definitions/" |
|
|
|
newScheduleContentType="application/vnd.sas.backup.request+json" # For a single-tenant deployment |
|
|
|
#newScheduleContentType="application/vnd.sas.backup.deployment.request+json" # For a multi-tenant deployment |
|
|
|
|
|
|
|
# Import Python modules |
|
|
|
|
|
|
|
import argparse |
|
|
|
import json |
|
|
|
import sys |
|
|
|
|
|
|
|
from sharedfunctions import callrestapi |
|
|
|
|
|
|
|
# Define exception handler so that we only output trace info from errors when in debug mode |
|
|
|
def exception_handler(exception_type, exception, traceback, debug_hook=sys.excepthook): |
|
|
|
if debug: |
|
|
|
debug_hook(exception_type, exception, traceback) |
|
|
|
else: |
|
|
|
print "%s: %s" % (exception_type.__name__, exception) |
|
|
|
print (exception_type.__name__, exception) |
|
|
|
|
|
|
|
sys.excepthook = exception_handler |
|
|
|
|
|
|
|
|
|
|
|
@ -33,14 +33,6 @@ import argparse |
|
|
|
import sys |
|
|
|
from sharedfunctions import callrestapi |
|
|
|
|
|
|
|
# Define exception handler so that we only output trace info from errors when in debug mode |
|
|
|
def exception_handler(exception_type, exception, traceback, debug_hook=sys.excepthook): |
|
|
|
if debug: |
|
|
|
debug_hook(exception_type, exception, traceback) |
|
|
|
else: |
|
|
|
print "%s: %s" % (exception_type.__name__, exception) |
|
|
|
|
|
|
|
sys.excepthook = exception_handler |
|
|
|
|
|
|
|
parser = argparse.ArgumentParser(description="Delete a publishing destination") |
|
|
|
parser.add_argument("-n","--name", help="Enter the name of the publishing destination to be deleted.",required=True) |
|
|
|
|
|
|
|
@ -60,6 +60,7 @@ import argparse |
|
|
|
import subprocess |
|
|
|
import json |
|
|
|
import sys |
|
|
|
import os |
|
|
|
from sharedfunctions import getfolderid,callrestapi,getapplicationproperties |
|
|
|
|
|
|
|
# get python version |
|
|
|
@ -86,7 +87,7 @@ def exception_handler(exception_type, exception, traceback, debug_hook=sys.excep |
|
|
|
if debug: |
|
|
|
debug_hook(exception_type, exception, traceback) |
|
|
|
else: |
|
|
|
print "%s: %s" % (exception_type.__name__, exception) |
|
|
|
print (exception_type.__name__, exception) |
|
|
|
|
|
|
|
sys.excepthook = exception_handler |
|
|
|
|
|
|
|
|
|
|
|
@ -31,6 +31,12 @@ |
|
|
|
# |
|
|
|
|
|
|
|
|
|
|
|
# Import Python modules |
|
|
|
import argparse |
|
|
|
import sys |
|
|
|
import os |
|
|
|
from sharedfunctions import getpath, getapplicationproperties |
|
|
|
|
|
|
|
# get python version |
|
|
|
version=int(str(sys.version_info[0])) |
|
|
|
|
|
|
|
@ -44,18 +50,12 @@ clicommand=os.path.join(clidir,cliexe) |
|
|
|
|
|
|
|
debug=False |
|
|
|
|
|
|
|
# Import Python modules |
|
|
|
import argparse |
|
|
|
import sys |
|
|
|
|
|
|
|
from sharedfunctions import getpath |
|
|
|
|
|
|
|
# Define exception handler so that we only output trace info from errors when in debug mode |
|
|
|
def exception_handler(exception_type, exception, traceback, debug_hook=sys.excepthook): |
|
|
|
if debug: |
|
|
|
debug_hook(exception_type, exception, traceback) |
|
|
|
else: |
|
|
|
print "%s: %s" % (exception_type.__name__, exception) |
|
|
|
print (exception_type.__name__, exception) |
|
|
|
|
|
|
|
sys.excepthook = exception_handler |
|
|
|
|
|
|
|
@ -69,4 +69,4 @@ debug=args.debug |
|
|
|
path=getpath(objecturi) |
|
|
|
|
|
|
|
if path is not None: |
|
|
|
print path |
|
|
|
print (path) |
|
|
|
|
|
|
|
@ -44,7 +44,7 @@ def exception_handler(exception_type, exception, traceback, debug_hook=sys.excep |
|
|
|
if debug: |
|
|
|
debug_hook(exception_type, exception, traceback) |
|
|
|
else: |
|
|
|
print "%s: %s" % (exception_type.__name__, exception) |
|
|
|
print (exception_type.__name__, exception) |
|
|
|
|
|
|
|
sys.excepthook = exception_handler |
|
|
|
|
|
|
|
|
|
|
|
@ -36,15 +36,6 @@ import swat # pip install swat |
|
|
|
import sys |
|
|
|
from sharedfunctions import callrestapi |
|
|
|
|
|
|
|
# Define exception handler so that we only output trace info from errors when in debug mode |
|
|
|
def exception_handler(exception_type, exception, traceback, debug_hook=sys.excepthook): |
|
|
|
if debug: |
|
|
|
debug_hook(exception_type, exception, traceback) |
|
|
|
else: |
|
|
|
print "%s: %s" % (exception_type.__name__, exception) |
|
|
|
|
|
|
|
sys.excepthook = exception_handler |
|
|
|
|
|
|
|
parser = argparse.ArgumentParser() |
|
|
|
parser.add_argument("--noheader", action='store_true', help="Do not print the header row") |
|
|
|
parser.add_argument("-d","--debug", action='store_true', help="Debug") |
|
|
|
|
|
|
|
@ -39,7 +39,7 @@ def exception_handler(exception_type, exception, traceback, debug_hook=sys.excep |
|
|
|
if debug: |
|
|
|
debug_hook(exception_type, exception, traceback) |
|
|
|
else: |
|
|
|
print "%s: %s" % (exception_type.__name__, exception) |
|
|
|
print (exception_type.__name__, exception) |
|
|
|
|
|
|
|
sys.excepthook = exception_handler |
|
|
|
|
|
|
|
|
|
|
|
@ -40,7 +40,7 @@ def exception_handler(exception_type, exception, traceback, debug_hook=sys.excep |
|
|
|
if debug: |
|
|
|
debug_hook(exception_type, exception, traceback) |
|
|
|
else: |
|
|
|
print "%s: %s" % (exception_type.__name__, exception) |
|
|
|
print (exception_type.__name__, exception) |
|
|
|
|
|
|
|
sys.excepthook = exception_handler |
|
|
|
|
|
|
|
@ -104,5 +104,5 @@ for server in servers: |
|
|
|
output=output+','+ai[col] |
|
|
|
else: |
|
|
|
output=output+',' |
|
|
|
print output |
|
|
|
print(output) |
|
|
|
|
|
|
|
|
|
|
|
@ -39,7 +39,7 @@ def exception_handler(exception_type, exception, traceback, debug_hook=sys.excep |
|
|
|
if debug: |
|
|
|
debug_hook(exception_type, exception, traceback) |
|
|
|
else: |
|
|
|
print "%s: %s" % (exception_type.__name__, exception) |
|
|
|
print (exception_type.__name__, exception) |
|
|
|
|
|
|
|
sys.excepthook = exception_handler |
|
|
|
|
|
|
|
|
|
|
|
@ -40,7 +40,7 @@ def exception_handler(exception_type, exception, traceback, debug_hook=sys.excep |
|
|
|
if debug: |
|
|
|
debug_hook(exception_type, exception, traceback) |
|
|
|
else: |
|
|
|
print "%s: %s" % (exception_type.__name__, exception) |
|
|
|
print (exception_type.__name__, exception) |
|
|
|
|
|
|
|
sys.excepthook = exception_handler |
|
|
|
|
|
|
|
|
|
|
|
@ -43,7 +43,7 @@ def exception_handler(exception_type, exception, traceback, debug_hook=sys.excep |
|
|
|
if debug: |
|
|
|
debug_hook(exception_type, exception, traceback) |
|
|
|
else: |
|
|
|
print "%s: %s" % (exception_type.__name__, exception) |
|
|
|
print (exception_type.__name__, exception) |
|
|
|
|
|
|
|
sys.excepthook = exception_handler |
|
|
|
|
|
|
|
|
|
|
|
@ -42,7 +42,7 @@ def exception_handler(exception_type, exception, traceback, debug_hook=sys.excep |
|
|
|
if debug: |
|
|
|
debug_hook(exception_type, exception, traceback) |
|
|
|
else: |
|
|
|
print "%s: %s" % (exception_type.__name__, exception) |
|
|
|
print (exception_type.__name__, exception) |
|
|
|
|
|
|
|
sys.excepthook = exception_handler |
|
|
|
|
|
|
|
|
|
|
|
@ -54,7 +54,7 @@ def exception_handler(exception_type, exception, traceback, debug_hook=sys.excep |
|
|
|
if debug: |
|
|
|
debug_hook(exception_type, exception, traceback) |
|
|
|
else: |
|
|
|
print "%s: %s" % (exception_type.__name__, exception) |
|
|
|
print (exception_type.__name__, exception) |
|
|
|
|
|
|
|
sys.excepthook = exception_handler |
|
|
|
|
|
|
|
|