From a618305bf46cd0355f46a498ffda73009ff0bcbc Mon Sep 17 00:00:00 2001 From: Chris Hambridge Date: Fri, 16 Jun 2017 15:26:05 -0400 Subject: [PATCH] move import from __future__ to top of files. --- rho/cli.py | 2 +- rho/clicommands.py | 34 +++++++++++++++++----------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/rho/cli.py b/rho/cli.py index 53ed3d1..588ecae 100644 --- a/rho/cli.py +++ b/rho/cli.py @@ -13,9 +13,9 @@ """ Rho Command Line Interface """ +from __future__ import print_function import sys import os -from __future__ import print_function import rho.clicommands import gettext diff --git a/rho/clicommands.py b/rho/clicommands.py index 1199ae7..1e28207 100644 --- a/rho/clicommands.py +++ b/rho/clicommands.py @@ -11,6 +11,7 @@ """ Rho CLI Commands """ +from __future__ import print_function import csv import os import sys @@ -25,7 +26,6 @@ from optparse import OptionParser from getpass import getpass import gettext -from __future__ import print_function t = gettext.translation('rho', 'locale', fallback=True) _ = t.ugettext @@ -503,8 +503,8 @@ def _do_command(self): _create_main_inventory(success_hosts, best_map, profile) elif not os.path.isfile('data/' + profile + '_hosts'): - print (_("Profile '%s' has not been processed. " - "Please use --reset with profile first.") % profile) + print("Profile '" + profile + "' has not been processed. " + + "Please use --reset with profile first.") sys.exit(1) cmd_string = 'ansible-playbook rho_playbook.yml -i data/'\ @@ -558,7 +558,7 @@ def _do_command(self): if line_list[0] == self.options.name: profile_exists = True profile_str = ', '.join(line_list[0:2] + [line_list[3]]) - print profile_str + print(profile_str) if not profile_exists: print(_("Profile '%s' does not exist.") % self.options.name) @@ -583,7 +583,7 @@ def _do_command(self): with open('data/profiles', 'r') as f: lines = f.readlines() for line in lines: - print line + print(line) class ProfileEditCommand(CliCommand): @@ -1054,14 +1054,14 @@ def _do_command(self): if line_list[1] == self.options.name: auth_exists = True if line_list[4] and line_list[3]: - print ', '.join(line_list[0:3]) +\ - ', ********, ' + line_list[4] + print(', '.join(line_list[0:3]) + + ', ********, ' + line_list[4]) elif not line_list[4]: - print ', '.join(line_list[0:3]) +\ - ', ********' + print(', '.join(line_list[0:3]) + + ', ********') else: - print ', '.join(line_list[0:3]) +\ - ', ' + line_list[4] + print(', '.join(line_list[0:3]) + + ', ' + line_list[4]) if not auth_exists: print('Auth "%s" does not exist' % self.options.name) @@ -1091,14 +1091,14 @@ def _do_command(self): for line in lines: line_list = line.strip().split(',') if line_list[3] and line_list[4]: - print ', '.join(line_list[0:3]) +\ - ', ********, ' + line_list[4] + print(', '.join(line_list[0:3]) + + ', ********, ' + line_list[4]) elif not line_list[4]: - print ', '.join(line_list[0:3]) +\ - ', ********' + print(', '.join(line_list[0:3]) + + ', ********') else: - print ', '.join(line_list[0:3]) +\ - ', ' + line_list[4] + print(', '.join(line_list[0:3]) + + ', ' + line_list[4]) class AuthAddCommand(CliCommand):