Skip to content

Commit

Permalink
fix: jans-linux-setup humanize os name (#2066)
Browse files Browse the repository at this point in the history
  • Loading branch information
devrimyatar committed Aug 9, 2022
1 parent 81472aa commit 8c89638
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
6 changes: 2 additions & 4 deletions jans-linux-setup/jans_setup/jans_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,10 @@ def ami_packaged():

if not Config.installed_instance:
print()
detected_os = '{} {}'.format(base.os_type, base.os_version)
if base.snap:
detected_os = 'snap ' + detected_os

print("Installing Janssen Server...\n\nFor more info see:\n {} \n {}\n".format(paths.LOG_FILE, paths.LOG_ERROR_FILE))
print("Profile : {}".format(Config.profile))
print("Detected OS : {}".format(detected_os))
print("Detected OS : {}".format(base.get_os_description()))
print("Janssen Version : {}".format(base.current_app.app_info['ox_version']))
print("Detected init : {}".format(base.os_initdaemon))
print("Detected Apache : {}".format(base.determineApacheVersion()))
Expand Down
13 changes: 13 additions & 0 deletions jans-linux-setup/jans_setup/setup_app/utils/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,19 @@
clone_type = 'deb'
httpd_name = 'apache2'

def get_os_description():
desc_dict = { 'suse': 'SUSE', 'red': 'RHEL', 'ubuntu': 'Ubuntu', 'deb': 'Debian', 'centos': 'CentOS', 'fedora': 'Fedora' }
descs = desc_dict.get(os_type, os_type)
descs += ' ' + os_version

fipsl = subprocess.getoutput("sysctl crypto.fips_enabled").strip().split()

if fipsl and fipsl[0] == 'crypto.fips_enabled' and fipsl[-1] == '1':
descs += ' [FIPS]'
if snap:
descs += ' [SNAP]'

return descs

if snap:
snapctl = shutil.which('snapctl')
Expand Down

0 comments on commit 8c89638

Please sign in to comment.