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
parent
commit
6e77802f9e
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. BIN
      __pycache__/sharedfunctions.cpython-36.pyc
  2. 19
      createbinarybackup.py
  3. 8
      deletepublishdest.py
  4. 3
      explainaccess.py
  5. 16
      getpath.py
  6. 2
      getruleid.py
  7. 9
      listallcasservercachestatus.py
  8. 2
      listcaslibs.py
  9. 4
      listcaslibsandeffectiveaccess.py
  10. 2
      listcastables.py
  11. 2
      listcastablesandeffectiveaccess.py
  12. 2
      listgroupsandmembers.py
  13. 2
      listmemberswithpath.py
  14. 2
      testfolderaccess.py

BIN
__pycache__/sharedfunctions.cpython-36.pyc

Binary file not shown.

19
createbinarybackup.py

@ -23,6 +23,14 @@
# limitations under the License. # limitations under the License.
# #
# Import Python modules
from sharedfunctions import callrestapi, getapplicationproperties
import argparse
import json
import sys
import os
# get python version # get python version
version=int(str(sys.version_info[0])) version=int(str(sys.version_info[0]))
@ -35,7 +43,6 @@ cliexe=propertylist["sascli.executable"]
clicommand=os.path.join(clidir,cliexe) clicommand=os.path.join(clidir,cliexe)
debug=False debug=False
defaultBackupScheduleName="DEFAULT_BACKUP_SCHEDULE" defaultBackupScheduleName="DEFAULT_BACKUP_SCHEDULE"
newScheduleName="BINARY_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.request+json" # For a single-tenant deployment
#newScheduleContentType="application/vnd.sas.backup.deployment.request+json" # For a multi-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 # 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): def exception_handler(exception_type, exception, traceback, debug_hook=sys.excepthook):
if debug: if debug:
debug_hook(exception_type, exception, traceback) debug_hook(exception_type, exception, traceback)
else: else:
print "%s: %s" % (exception_type.__name__, exception) print (exception_type.__name__, exception)
sys.excepthook = exception_handler sys.excepthook = exception_handler

8
deletepublishdest.py

@ -33,14 +33,6 @@ import argparse
import sys import sys
from sharedfunctions import callrestapi 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 = 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) parser.add_argument("-n","--name", help="Enter the name of the publishing destination to be deleted.",required=True)

3
explainaccess.py

@ -60,6 +60,7 @@ import argparse
import subprocess import subprocess
import json import json
import sys import sys
import os
from sharedfunctions import getfolderid,callrestapi,getapplicationproperties from sharedfunctions import getfolderid,callrestapi,getapplicationproperties
# get python version # get python version
@ -86,7 +87,7 @@ def exception_handler(exception_type, exception, traceback, debug_hook=sys.excep
if debug: if debug:
debug_hook(exception_type, exception, traceback) debug_hook(exception_type, exception, traceback)
else: else:
print "%s: %s" % (exception_type.__name__, exception) print (exception_type.__name__, exception)
sys.excepthook = exception_handler sys.excepthook = exception_handler

16
getpath.py

@ -31,6 +31,12 @@
# #
# Import Python modules
import argparse
import sys
import os
from sharedfunctions import getpath, getapplicationproperties
# get python version # get python version
version=int(str(sys.version_info[0])) version=int(str(sys.version_info[0]))
@ -44,18 +50,12 @@ clicommand=os.path.join(clidir,cliexe)
debug=False 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 # 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): def exception_handler(exception_type, exception, traceback, debug_hook=sys.excepthook):
if debug: if debug:
debug_hook(exception_type, exception, traceback) debug_hook(exception_type, exception, traceback)
else: else:
print "%s: %s" % (exception_type.__name__, exception) print (exception_type.__name__, exception)
sys.excepthook = exception_handler sys.excepthook = exception_handler
@ -69,4 +69,4 @@ debug=args.debug
path=getpath(objecturi) path=getpath(objecturi)
if path is not None: if path is not None:
print path print (path)

2
getruleid.py

@ -44,7 +44,7 @@ def exception_handler(exception_type, exception, traceback, debug_hook=sys.excep
if debug: if debug:
debug_hook(exception_type, exception, traceback) debug_hook(exception_type, exception, traceback)
else: else:
print "%s: %s" % (exception_type.__name__, exception) print (exception_type.__name__, exception)
sys.excepthook = exception_handler sys.excepthook = exception_handler

9
listallcasservercachestatus.py

@ -36,15 +36,6 @@ import swat # pip install swat
import sys import sys
from sharedfunctions import callrestapi 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 = argparse.ArgumentParser()
parser.add_argument("--noheader", action='store_true', help="Do not print the header row") parser.add_argument("--noheader", action='store_true', help="Do not print the header row")
parser.add_argument("-d","--debug", action='store_true', help="Debug") parser.add_argument("-d","--debug", action='store_true', help="Debug")

2
listcaslibs.py

@ -39,7 +39,7 @@ def exception_handler(exception_type, exception, traceback, debug_hook=sys.excep
if debug: if debug:
debug_hook(exception_type, exception, traceback) debug_hook(exception_type, exception, traceback)
else: else:
print "%s: %s" % (exception_type.__name__, exception) print (exception_type.__name__, exception)
sys.excepthook = exception_handler sys.excepthook = exception_handler

4
listcaslibsandeffectiveaccess.py

@ -40,7 +40,7 @@ def exception_handler(exception_type, exception, traceback, debug_hook=sys.excep
if debug: if debug:
debug_hook(exception_type, exception, traceback) debug_hook(exception_type, exception, traceback)
else: else:
print "%s: %s" % (exception_type.__name__, exception) print (exception_type.__name__, exception)
sys.excepthook = exception_handler sys.excepthook = exception_handler
@ -104,5 +104,5 @@ for server in servers:
output=output+','+ai[col] output=output+','+ai[col]
else: else:
output=output+',' output=output+','
print output print(output)

2
listcastables.py

@ -39,7 +39,7 @@ def exception_handler(exception_type, exception, traceback, debug_hook=sys.excep
if debug: if debug:
debug_hook(exception_type, exception, traceback) debug_hook(exception_type, exception, traceback)
else: else:
print "%s: %s" % (exception_type.__name__, exception) print (exception_type.__name__, exception)
sys.excepthook = exception_handler sys.excepthook = exception_handler

2
listcastablesandeffectiveaccess.py

@ -40,7 +40,7 @@ def exception_handler(exception_type, exception, traceback, debug_hook=sys.excep
if debug: if debug:
debug_hook(exception_type, exception, traceback) debug_hook(exception_type, exception, traceback)
else: else:
print "%s: %s" % (exception_type.__name__, exception) print (exception_type.__name__, exception)
sys.excepthook = exception_handler sys.excepthook = exception_handler

2
listgroupsandmembers.py

@ -43,7 +43,7 @@ def exception_handler(exception_type, exception, traceback, debug_hook=sys.excep
if debug: if debug:
debug_hook(exception_type, exception, traceback) debug_hook(exception_type, exception, traceback)
else: else:
print "%s: %s" % (exception_type.__name__, exception) print (exception_type.__name__, exception)
sys.excepthook = exception_handler sys.excepthook = exception_handler

2
listmemberswithpath.py

@ -42,7 +42,7 @@ def exception_handler(exception_type, exception, traceback, debug_hook=sys.excep
if debug: if debug:
debug_hook(exception_type, exception, traceback) debug_hook(exception_type, exception, traceback)
else: else:
print "%s: %s" % (exception_type.__name__, exception) print (exception_type.__name__, exception)
sys.excepthook = exception_handler sys.excepthook = exception_handler

2
testfolderaccess.py

@ -54,7 +54,7 @@ def exception_handler(exception_type, exception, traceback, debug_hook=sys.excep
if debug: if debug:
debug_hook(exception_type, exception, traceback) debug_hook(exception_type, exception, traceback)
else: else:
print "%s: %s" % (exception_type.__name__, exception) print (exception_type.__name__, exception)
sys.excepthook = exception_handler sys.excepthook = exception_handler

Loading…
Cancel
Save