Skip to content

Commit

Permalink
Hide CAS installation by default #252
Browse files Browse the repository at this point in the history
  • Loading branch information
dmogn committed Jan 19, 2017
1 parent 33ea34b commit 82f5637
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ def __init__(self, install_dir=None):
self.installOxAuthRP = False
self.installPassport = False
self.allowPreReleasedApplications = False
self.allowDeprecatedApplications = False

self.os_types = ['centos', 'redhat', 'fedora', 'ubuntu', 'debian']
self.os_type = None
Expand Down Expand Up @@ -1947,12 +1948,6 @@ def promptForProperties(self):
else:
self.installAsimba = False

promptForCAS = self.getPrompt("Install CAS?", "No")[0].lower()
if promptForCAS == 'y':
self.installCas = True
else:
self.installCas = False

promptForOxAuthRP = self.getPrompt("Install oxAuth RP?", "No")[0].lower()
if promptForOxAuthRP == 'y':
self.installOxAuthRP = True
Expand All @@ -1964,6 +1959,13 @@ def promptForProperties(self):
self.installPassport = True
else:
self.installPassport = False

if self.allowDeprecatedApplications:
promptForCAS = self.getPrompt("Install CAS? [WARNING: Deprecated Application]", "No")[0].lower()
if promptForCAS == 'y':
self.installCas = True
else:
self.installCas = False

def get_filepaths(self, directory):
file_paths = []
Expand Down Expand Up @@ -2436,7 +2438,6 @@ def print_help():
print ""
print " -a Install Asimba"
print " -r Install oxAuth RP"
print " -c Install CAS"
print " -p Install Passport"
print " -d specify the directory where community-edition-setup is located. Defaults to '.'"
print " -f specify setup.properties file"
Expand All @@ -2447,18 +2448,17 @@ def print_help():
print " -u Update hosts file with IP address / hostname"
print " -w Get the development head war files"
print " --allow_pre_released_applications"
print " --allow_deprecated_applications"

def getOpts(argv, setupOptions):
try:
opts, args = getopt.getopt(argv, "acd:f:hNnsuwr", ['allow_pre_released_applications'])
opts, args = getopt.getopt(argv, "ad:f:hNnsuwr", ['allow_pre_released_applications', 'allow_deprecated_applications'])
except getopt.GetoptError:
print_help()
sys.exit(2)
for opt, arg in opts:
if opt == '-a':
setupOptions['installAsimba'] = True
elif opt == '-c':
setupOptions['installCas'] = True
elif opt == '-d':
if os.path.exists(arg):
setupOptions['install_dir'] = arg
Expand Down Expand Up @@ -2492,6 +2492,8 @@ def getOpts(argv, setupOptions):
setupOptions['installPassport'] = True
elif opt == '--allow_pre_released_applications':
setupOptions['allowPreReleasedApplications'] = True
elif opt == '--allow_deprecated_applications':
setupOptions['allowDeprecatedApplications'] = True
return setupOptions

if __name__ == '__main__':
Expand All @@ -2510,7 +2512,8 @@ def getOpts(argv, setupOptions):
'installCas': False,
'installOxAuthRP': False,
'installPassport': False,
'allowPreReleasedApplications': False
'allowPreReleasedApplications': False,
'allowDeprecatedApplications': False
}
if len(sys.argv) > 1:
setupOptions = getOpts(sys.argv[1:], setupOptions)
Expand All @@ -2529,6 +2532,7 @@ def getOpts(argv, setupOptions):
installObject.installOxAuthRP = setupOptions['installOxAuthRP']
installObject.installPassport = setupOptions['installPassport']
installObject.allowPreReleasedApplications = setupOptions['allowPreReleasedApplications']
installObject.allowDeprecatedApplications = setupOptions['allowDeprecatedApplications']

# Get the OS type
installObject.os_type = installObject.detect_os_type()
Expand Down

0 comments on commit 82f5637

Please sign in to comment.