From a20460db4d0ea85df0e6d46c225c8f05c0797db3 Mon Sep 17 00:00:00 2001 From: Jared Tabor Date: Mon, 11 Aug 2014 14:47:57 -0400 Subject: [PATCH 1/3] got rid of horizontal scroll bar on about dialog modal --- awx/ui/static/js/helpers/AboutAnsible.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/awx/ui/static/js/helpers/AboutAnsible.js b/awx/ui/static/js/helpers/AboutAnsible.js index 40b9eaadfe..a57b1bb344 100644 --- a/awx/ui/static/js/helpers/AboutAnsible.js +++ b/awx/ui/static/js/helpers/AboutAnsible.js @@ -44,16 +44,13 @@ angular.module('AboutAnsibleHelpModal', ['RestServices', 'Utilities','ModalDialo scope.removeBuildAboutDialog = scope.$on('BuildAboutDialog', function(e, data) { var spaces, i, j, paddedStr = "", - str = data.version; + version = data.version.replace(/-\d*$/,''); - if(str.search('-')){ - str = str.substr(0,str.search('-')); - } - spaces = Math.floor((16-str.length)/2); + spaces = Math.floor((16-version.length)/2); for( i=0; i<=spaces; i++){ paddedStr = paddedStr +" "; } - paddedStr = paddedStr+str; + paddedStr = paddedStr+version; for( j = paddedStr.length; j<16; j++){ paddedStr = paddedStr + " "; } @@ -65,7 +62,7 @@ angular.module('AboutAnsibleHelpModal', ['RestServices', 'Utilities','ModalDialo id: 'about-modal-dialog', scope: scope, // buttons: [], - width: 700, + width: 710, height: 380, minWidth: 300, resizable: false, @@ -74,6 +71,8 @@ angular.module('AboutAnsibleHelpModal', ['RestServices', 'Utilities','ModalDialo onOpen: function(){ $('#dialog-ok-button').focus(); $('#about-modal-dialog').scrollTop(0); + $('#about-modal-dialog').css('overflow-x', 'hidden'); + $('.ui-widget-overlay').css('width', '100%'); } }); }); From f0b1546653d21581b632ed100147c17696b32bd7 Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Mon, 11 Aug 2014 15:09:17 -0400 Subject: [PATCH 2/3] Add sosreport support to Tower --- MANIFEST.in | 1 + setup.py | 9 +++++++++ tools/sosreport/tower-sos2.py | 36 ++++++++++++++++++++++++++++++++++ tools/sosreport/tower-sos3.py | 37 +++++++++++++++++++++++++++++++++++ 4 files changed, 83 insertions(+) create mode 100644 tools/sosreport/tower-sos2.py create mode 100644 tools/sosreport/tower-sos3.py diff --git a/MANIFEST.in b/MANIFEST.in index 184159d69f..504417d9ce 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -21,6 +21,7 @@ include awx/ui/static/js/config.js include tools/scripts/request_tower_configuration.sh include tools/scripts/ansible-tower include tools/munin_monitors/* +include tools/sosreport/* include COPYING prune awx/public prune awx/projects diff --git a/setup.py b/setup.py index c9016f66ca..228d50b844 100755 --- a/setup.py +++ b/setup.py @@ -22,10 +22,18 @@ munin_plugin_conf_path = "/etc/munin/plugin-conf.d" if os.path.exists("/etc/debian_version"): sysinit = "/etc/init.d" webconfig = "/etc/apache2/conf.d" + sosconfig = "/usr/share/sosreport/sos/plugins" + sosfile = "tower-sos3.py shutil.copy("config/awx-munin-ubuntu.conf", "config/awx-munin.conf") else: sysinit = "/etc/rc.d/init.d" webconfig = "/etc/httpd/conf.d" + if os.path.exists("/usr/lib/python2.7/site-packages"): + sosconfig = "/usr/lib/python2.7/site-packages/sos/plugins" + sosfile = "tower-sos3.py + else: + sosconfig = "/usr/lib/python2.6/site-packages/sos/plugins" + sosfile = "tower-sos2.py" shutil.copy("config/awx-munin-el.conf", "config/awx-munin.conf") ##################################################################### @@ -214,6 +222,7 @@ setup( "tools/munin_monitors/taskmanager_alive"]), ("%s" % munin_plugin_conf_path, ["config/awx_munin_tower_jobs"]), ("%s" % sysinit, ["tools/scripts/ansible-tower"]), + ("%s" % sosconfig, ["tools/sosreport/%s" % sosfile]), ] ), options = { diff --git a/tools/sosreport/tower-sos2.py b/tools/sosreport/tower-sos2.py new file mode 100644 index 0000000000..72c346ec09 --- /dev/null +++ b/tools/sosreport/tower-sos2.py @@ -0,0 +1,36 @@ +# Copyright (c) 2014 Ansible, Inc. +# All Rights Reserved. + +import sos.plugintools + +class tower(sos.plugintools.PluginBase): + '''Tower SOS plugin''' + + def setup(self): + + commands = [ + "ansible --version", # ansible core version + "awx-manage --version", # tower version + "supervisorctl status", # tower process status + "tree -d /var/lib/awx", # show me the dirs + "ls -ll /var/lib/awx", # check permissions + "ls -ll /etc/awx" + ] + + dirs = [ + "/etc/awx/", + "/var/log/supervisor/", + "/var/log/syslog", + "/var/log/udev", + "/var/log/kern*", + "/var/log/dist-upgrade", + "/var/log/installer", + "/var/log/unattended-upgrades", + "/var/log/apport.log" + ] + + for path in dirs: + self.addCopySpec(path) + + for command in commands: + self.collectExtOutput(command) diff --git a/tools/sosreport/tower-sos3.py b/tools/sosreport/tower-sos3.py new file mode 100644 index 0000000000..5da4e1dbf2 --- /dev/null +++ b/tools/sosreport/tower-sos3.py @@ -0,0 +1,37 @@ +# Copyright (c) 2014 Ansible, Inc. +# All Rights Reserved. + +from sos.plugins import Plugin, RedHatPlugin, UbuntuPlugin + +class tower(Plugin, RedHatPlugin, UbuntuPlugin): + '''Tower SOS plugin''' + plugin_name = "tower" + + def setup(self): + + commands = [ + "ansible --version", # ansible core version + "awx-manage --version", # tower version + "supervisorctl status", # tower process status + "tree -d /var/lib/awx", # show me the dirs + "ls -ll /var/lib/awx", # check permissions + "ls -ll /etc/awx" + ] + + dirs = [ + "/etc/awx/", + "/var/log/supervisor/", + "/var/log/syslog", + "/var/log/udev", + "/var/log/kern*", + "/var/log/dist-upgrade", + "/var/log/installer", + "/var/log/unattended-upgrades", + "/var/log/apport.log" + ] + + for path in dirs: + self.add_copy_spec(path) + + for command in commands: + self.collect_ext_output(command) From 7db362352112a88d5af7b45663fb6e93698647e0 Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Mon, 11 Aug 2014 15:31:18 -0400 Subject: [PATCH 3/3] Fix up sosfile strings in setup.py --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 228d50b844..95302f289f 100755 --- a/setup.py +++ b/setup.py @@ -23,14 +23,14 @@ if os.path.exists("/etc/debian_version"): sysinit = "/etc/init.d" webconfig = "/etc/apache2/conf.d" sosconfig = "/usr/share/sosreport/sos/plugins" - sosfile = "tower-sos3.py + sosfile = "tower-sos3.py" shutil.copy("config/awx-munin-ubuntu.conf", "config/awx-munin.conf") else: sysinit = "/etc/rc.d/init.d" webconfig = "/etc/httpd/conf.d" if os.path.exists("/usr/lib/python2.7/site-packages"): sosconfig = "/usr/lib/python2.7/site-packages/sos/plugins" - sosfile = "tower-sos3.py + sosfile = "tower-sos3.py" else: sosconfig = "/usr/lib/python2.6/site-packages/sos/plugins" sosfile = "tower-sos2.py"