Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: jans-linux-setup typo #2523

Merged
merged 1 commit into from
Oct 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion jans-linux-setup/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ class SampleInstaller(JettyInstaller):
# services, for example, systemctl start application

self.app_type = static.AppType.SERVICE # enumartiation for application type, etiher APPLICATION or SERVICE
self.install_type = static.InstallOption.OPTONAL # enumartiation for installation type, etiher MONDATORY or OPTONAL
self.install_type = static.InstallOption.OPTONAL # enumartiation for installation type, etiher MANDATORY or OPTONAL
self.install_var = 'installApplication' # variale defined in Config to determine if thi application is going to be installed or not
self.register_progess() # we need to register to progress indicator so that it will shows status of installation during installation process

Expand Down
2 changes: 1 addition & 1 deletion jans-linux-setup/jans_setup/jans_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ class PostSetup:
service_name = 'post-setup'
install_var = 'installPostSetup'
app_type = static.AppType.APPLICATION
install_type = static.InstallOption.MONDATORY
install_type = static.InstallOption.MANDATORY


jansProgress.register(PostSetup)
Expand Down
20 changes: 10 additions & 10 deletions jans-linux-setup/jans_setup/setup_app/data/package_list.json
Original file line number Diff line number Diff line change
@@ -1,52 +1,52 @@
{
"red 7": {
"optional": "",
"mondatory": "httpd httpd-mod_ssl mod_auth_openidc curl wget tar xz unzip rsyslog bzip2",
"mandatory": "httpd httpd-mod_ssl mod_auth_openidc curl wget tar xz unzip rsyslog bzip2",
"python": {"ldap3":"python3-ldap3", "requests":"python3-requests", "ruamel.yaml":"python3-ruamel-yaml", "certifi":"python3-certifi", "pymysql":"python3-PyMySQL", "Crypto": "python3-cryptography", "prompt_toolkit": "python3-prompt-toolkit", "psycopg2":"python3-psycopg2"}
},
"red 8": {
"optional": "",
"mondatory": "httpd mod_ssl mod_auth_openidc curl wget tar xz unzip rsyslog bzip2",
"mandatory": "httpd mod_ssl mod_auth_openidc curl wget tar xz unzip rsyslog bzip2",
"python": {"ldap3":"python3-ldap3", "requests":"python3-requests", "ruamel.yaml":"python3-ruamel-yaml", "certifi":"python3-certifi", "pymysql":"python3-PyMySQL", "Crypto": "python3-cryptography", "prompt_toolkit": "python3-prompt-toolkit", "psycopg2":"python3-psycopg2"}
},
"centos 7": {
"optional": "",
"mondatory": "httpd mod_ssl curl mod_auth_openidc wget tar xz unzip bzip2 rsyslog python3-certifi",
"mandatory": "httpd mod_ssl curl mod_auth_openidc wget tar xz unzip bzip2 rsyslog python3-certifi",
"python": {"ldap3":"python3-ldap3", "requests":"python3-requests", "ruamel.yaml":"python3-ruamel-yaml", "pymysql":"python3-PyMySQL", "Crypto": "python3-cryptography", "prompt_toolkit": "python3-prompt-toolkit", "psycopg2":"python3-psycopg2"}
},
"centos 8": {
"optional": "",
"mondatory": "httpd mod_ssl mod_auth_openidc curl wget tar xz unzip rsyslog bzip2",
"mandatory": "httpd mod_ssl mod_auth_openidc curl wget tar xz unzip rsyslog bzip2",
"python": {"ldap3":"python3-ldap3", "requests":"python3-requests", "ruamel.yaml":"python3-ruamel-yaml", "certifi":"python3-certifi", "pymysql":"python3-PyMySQL", "Crypto": "python3-cryptography", "prompt_toolkit": "python3-prompt-toolkit", "psycopg2":"python3-psycopg2"}
},
"suse 15": {
"optional": "",
"mondatory": "apache2 apache2-mod_auth_openidc curl wget tar xz unzip rsyslog bzip2",
"mandatory": "apache2 apache2-mod_auth_openidc curl wget tar xz unzip rsyslog bzip2",
"python": {"ldap3":"python3-ldap3", "requests":"python3-requests", "ruamel.yaml":"python3-ruamel.yaml", "certifi":"python3-certifi", "pymysql":"python3-PyMySQL", "Crypto": "python3-cryptography", "prompt_toolkit": "python3-prompt_toolkit", "psycopg2":"python3-psycopg2"}
},
"debian 11": {
"optional": "",
"mondatory": "apache2 curl wget tar xz-utils unzip rsyslog bzip2",
"mandatory": "apache2 curl wget tar xz-utils unzip rsyslog bzip2",
"python": {"ldap3":"python3-ldap3", "requests":"python3-requests", "ruamel.yaml":"python3-ruamel.yaml", "certifi":"python3-certifi", "pymysql":"python3-pymysql", "cryptography":"python3-cryptography", "distutils.util": "python3-distutils", "prompt_toolkit": "python3-prompt-toolkit", "psycopg2":"python3-psycopg2"}
},
"debian 10": {
"optional": "",
"mondatory": "apache2 curl wget tar xz-utils unzip rsyslog bzip2",
"mandatory": "apache2 curl wget tar xz-utils unzip rsyslog bzip2",
"python": {"ldap3":"python3-ldap3", "requests":"python3-requests", "ruamel.yaml":"python3-ruamel.yaml", "certifi":"python3-certifi", "pymysql":"python3-pymysql", "Crypto": "python3-crypto", "distutils.util": "python3-distutils", "prompt_toolkit": "python3-prompt-toolkit", "psycopg2":"python3-psycopg2"}
},
"debian 9": {
"optional": "",
"mondatory": "apache2 curl wget tar xz-utils unzip rsyslog bzip2",
"mandatory": "apache2 curl wget tar xz-utils unzip rsyslog bzip2",
"python": {"ldap3":"python3-ldap3", "requests":"python3-requests", "ruamel.yaml":"python3-ruamel.yaml", "certifi":"python3-certifi", "pymysql":"python3-pymysql", "Crypto": "python3-crypto", "distutils.util": "python3-distutils", "prompt_toolkit": "python3-prompt-toolkit", "psycopg2":"python3-psycopg2"}
},
"ubuntu 20": {
"optional": "",
"mondatory": "apache2 curl wget xz-utils unzip rsyslog bzip2 python3-urllib3 python3-certifi",
"mandatory": "apache2 curl wget xz-utils unzip rsyslog bzip2 python3-urllib3 python3-certifi",
"python": {"ldap3":"python3-ldap3", "requests":"python3-requests", "ruamel.yaml":"python3-ruamel.yaml", "pymysql":"python3-pymysql", "Crypto": "python3-crypto", "distutils.util": "python3-distutils", "prompt_toolkit": "python3-prompt-toolkit", "psycopg2":"python3-psycopg2"}
},
"ubuntu 22": {
"optional": "",
"mondatory": "apache2 curl wget xz-utils unzip rsyslog bzip2 python3-urllib3 python3-certifi",
"mandatory": "apache2 curl wget xz-utils unzip rsyslog bzip2 python3-urllib3 python3-certifi",
"python": {"ldap3":"python3-ldap3", "requests":"python3-requests", "ruamel.yaml":"python3-ruamel.yaml", "pymysql":"python3-pymysql", "cryptography":"python3-cryptography", "distutils.util": "python3-distutils", "prompt_toolkit": "python3-prompt-toolkit", "certifi":"python3-certifi", "psycopg2":"python3-psycopg2"}
}
}
2 changes: 1 addition & 1 deletion jans-linux-setup/jans_setup/setup_app/installers/jans.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def __repr__(self):
def initialize(self):
self.service_name = 'jans'
self.app_type = AppType.APPLICATION
self.install_type = InstallOption.MONDATORY
self.install_type = InstallOption.MANDATORY
jansProgress.register(self)

Config.install_time_ldap = time.strftime('%Y%m%d%H%M%SZ', time.gmtime(time.time()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def __init__(self):
self.needdb = False # we don't need backend connection in this class
self.install_var = 'installJetty'
self.app_type = AppType.APPLICATION
self.install_type = InstallOption.MONDATORY
self.install_type = InstallOption.MANDATORY
if not base.snap:
self.register_progess()
self.jetty_user_home = '/home/jetty'
Expand Down
2 changes: 1 addition & 1 deletion jans-linux-setup/jans_setup/setup_app/installers/jre.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def __init__(self):
self.needdb = False # we don't need backend connection in this class
self.install_var = 'installJre'
self.app_type = AppType.APPLICATION
self.install_type = InstallOption.MONDATORY
self.install_type = InstallOption.MANDATORY
if not base.snap:
self.register_progess()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def __init__(self):
self.service_name = 'jython'
self.install_var = 'installJython'
self.app_type = AppType.APPLICATION
self.install_type = InstallOption.MONDATORY
self.install_type = InstallOption.MANDATORY
if not base.snap:
self.register_progess()

Expand Down
2 changes: 1 addition & 1 deletion jans-linux-setup/jans_setup/setup_app/static.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class AppType:
SERVICE = 2

class InstallOption:
MONDATORY = 1
MANDATORY = 1
OPTONAL = 2

class SetupProfiles:
Expand Down
16 changes: 8 additions & 8 deletions jans-linux-setup/jans_setup/setup_app/utils/package_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,24 +48,24 @@ def check_and_install_packages(self):

install_command, update_command, query_command, check_text = self.get_install_commands()

install_list = {'mondatory': [], 'optional': []}
install_list = {'mandatory': [], 'optional': []}

package_list = base.get_os_package_list()

os_type_version = base.os_type + ' ' + base.os_version

if base.argsp.local_rdbm == 'mysql' or (Config.get('rdbm_install_type') == InstallTypes.LOCAL and Config.rdbm_type == 'mysql'):
package_list[os_type_version]['mondatory'] += ' mysql-server'
package_list[os_type_version]['mandatory'] += ' mysql-server'
if base.argsp.local_rdbm == 'pgsql' or (Config.get('rdbm_install_type') == InstallTypes.LOCAL and Config.rdbm_type == 'pgsql'):
package_list[os_type_version]['mondatory'] += ' postgresql python3-psycopg2'
package_list[os_type_version]['mandatory'] += ' postgresql python3-psycopg2'
if base.clone_type == 'deb':
package_list[os_type_version]['mondatory'] += ' postgresql-contrib'
package_list[os_type_version]['mandatory'] += ' postgresql-contrib'

for pypackage in package_list[os_type_version]['python']:
try:
importlib.import_module(pypackage)
except:
package_list[os_type_version]['mondatory'] += ' ' + package_list[os_type_version]['python'][pypackage]
package_list[os_type_version]['mandatory'] += ' ' + package_list[os_type_version]['python'][pypackage]

for install_type in install_list:
for package in package_list[os_type_version][install_type].split():
Expand All @@ -80,20 +80,20 @@ def check_and_install_packages(self):
self.logIt('Package {0} was not installed'.format(package_query))
install_list[install_type].append(package_query)

install = {'mondatory': True, 'optional': False}
install = {'mandatory': True, 'optional': False}

for install_type in install_list:
if install_list[install_type]:
packages = " ".join(install_list[install_type])

if install_type == 'mondatory':
if install_type == 'mandatory':
print("The following packages are required for Janssen Server")
print(packages)
if not base.argsp.n:
r = input("Do you want to install these now? [Y/n] ")
if r and r.lower()=='n':
install[install_type] = False
if install_type == 'mondatory':
if install_type == 'mandatory':
print("Can not proceed without installing required packages. Exiting ...")
sys.exit()

Expand Down