diff --git a/roles/task-shortcuts/files/uug-ansible-wrapper.py b/roles/task-shortcuts/files/uug-ansible-wrapper.py
index 0c6bea60..a52bbfa8 100755
--- a/roles/task-shortcuts/files/uug-ansible-wrapper.py
+++ b/roles/task-shortcuts/files/uug-ansible-wrapper.py
@@ -26,7 +26,7 @@
# Map of course names to the Ansible tags
courses = {'CS 101': 'cs101', 'CS 149': 'cs149', 'CS 159': 'cs159',
'CS 261': 'cs261', 'CS 354': 'cs354'}
-user_config_path = os.environ['HOME'] + "/.config/vm_config"
+user_config_path = os.path.join(os.environ['HOME'], ".config", "vm_config")
user_config = {}
release = None
url = None
@@ -85,16 +85,16 @@ def __init__(self):
# dictionaries do not guarantee that order is preserved
for (course, tag) in sorted(courses.items()):
checkbox = Gtk.CheckButton(course)
- checkbox.set_tooltip_text("Configure for " + course)
+ checkbox.set_tooltip_text("Configure for %s" % course)
checkbox.connect("toggled", self.on_button_toggled, tag)
courses_box.pack_start(checkbox, False, False, 0)
vbox.pack_start(courses_box, False, False, 0)
# Add informational labels to the bottom of the window
label_box = Gtk.Box(spacing=6)
- url_label = Gtk.Label("URL: " + url)
+ url_label = Gtk.Label("URL: %s" % url)
label_box.pack_start(url_label, False, False, 6)
- branch_label = Gtk.Label("Branch: " + release)
+ branch_label = Gtk.Label("Branch: %s" % release)
label_box.pack_start(branch_label, False, False, 6)
vbox.pack_end(label_box, False, False, 0)
@@ -128,8 +128,8 @@ def sub_command_exited(self, widget, exit_status):
self.cancel_button.set_sensitive(True)
self.run_button.set_sensitive(True)
if exit_status == 0:
- success_msg = "Your machine has been configured for: " + \
- ",".join(tags)
+ success_msg = "Your machine has been configured for: %s" \
+ % (",".join(tags))
show_dialog(self, Gtk.MessageType.INFO, Gtk.ButtonsType.OK,
"Complete", success_msg)
# 65280 should be the exit code if the gksudo dialog is dismissed
@@ -144,7 +144,7 @@ def sub_command_exited(self, widget, exit_status):
" configuration tasks. Please try again." \
"\nIf this issue continues to occur, copy" \
" /opt/vmtools/logs/last_run.log and" \
- " create an issue"
+ " create an issue" % (url)
show_dialog(self, Gtk.MessageType.ERROR, Gtk.ButtonsType.OK,
"Error", ansible_err_msg)
@@ -273,11 +273,10 @@ def invalid_branch(parent, release, url):
"""Displays a dialog if the branch choses does not exist on the remote"""
bad_branch_msg = "The release chosen does not exist at the project URL." \
" Please check the settings listed below and try again." \
- "\nRelease: " + release + "\nURL: " + url + \
- "\nIf you're using a current release of Linux Mint, you" \
- " may submit" \
- " an issue requesting support" \
- " for the release list above."
+ "\nRelease: %s\nURL: %s\nIf you're using a current"\
+ " release of Linux Mint, you may submit"\
+ " an issue requesting support for the" \
+ " release listed above" % (release, url, url)
show_dialog(parent, Gtk.MessageType.ERROR, Gtk.ButtonsType.CANCEL,
"Invalid Release", bad_branch_msg)
Gtk.main_quit()