diff options
author | Vincenzo Maffione <v.maffione@gmail.com> | 2017-04-08 12:55:15 +0200 |
---|---|---|
committer | Vincenzo Maffione <v.maffione@gmail.com> | 2017-04-08 12:55:15 +0200 |
commit | 8d4ba82ac3a598992ee3d8fbe7ea14375b7c0801 (patch) | |
tree | 26fc3690f4b3bc7c7a5635ee31f0297bb66ead19 | |
parent | 23ed7dceee1eecff9e80862b650824deb5bdb187 (diff) | |
download | rumba-8d4ba82ac3a598992ee3d8fbe7ea14375b7c0801.tar.gz rumba-8d4ba82ac3a598992ee3d8fbe7ea14375b7c0801.zip |
testbeds: qemu: use % for formatting strings
-rw-r--r-- | rumba/testbeds/qemu.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/rumba/testbeds/qemu.py b/rumba/testbeds/qemu.py index 897af37..1830b37 100644 --- a/rumba/testbeds/qemu.py +++ b/rumba/testbeds/qemu.py @@ -57,7 +57,7 @@ class Testbed(mod.Testbed): for command in commands: if not error_queue.empty(): break - print('DEBUG: executing >> {}'.format(command)) + print('DEBUG: executing >> %s' % command) subprocess.check_call(command.split()) results_queue.put("Command chain ran correctly.") @@ -70,7 +70,7 @@ class Testbed(mod.Testbed): :param experiment: The experiment running """ if os.geteuid() != 0: - pw = getpass.getpass('[sudo] password for {}:'.format(getpass.getuser())) + pw = getpass.getpass('[sudo] password for %s:' % getpass.getuser()) if '"' in pw or "'" in pw: print('Illegal password: contains " or \'') raise Exception('Not authenticated') @@ -142,8 +142,8 @@ class Testbed(mod.Testbed): # Check for errors if not e_queue.empty(): error_str = str(e_queue.get()) - print('Testbed instantiation failed: {}'.format(error_str)) - raise Exception('Failure: {}'.format(error_str)) + print('Testbed instantiation failed: %s' % error_str) + raise Exception('Failure: %s' % error_str) try: # Check for results result = r_queue.get(timeout=1) @@ -218,12 +218,12 @@ class Testbed(mod.Testbed): booting_budget -= 1 if booting_budget <= 0: - print('Sleeping for {} seconds to give the machines time to boot up.'.format(boot_backoff)) + print('Sleeping for %s seconds to give the machines time to boot up.' % boot_backoff) time.sleep(boot_backoff) booting_budget = boot_batch_size with open('%s/qemu_out_%s' % (self.qemu_logs_dir, vmid), 'w') as out_file: - print('DEBUG: executing >> {}'.format(command)) + print('DEBUG: executing >> %s' % command) self.boot_processes.append(subprocess.Popen(command.split(), stdout=out_file)) pass @@ -268,7 +268,7 @@ class Testbed(mod.Testbed): while max_waiting_time > 0 and over_processes < total_processes: # Check for errors if not error_queue.empty(): - print('Failure while shutting down: {}'.format(str(error_queue.get()))) + print('Failure while shutting down: %s' % str(error_queue.get())) over_processes += 1 try: # Check for results @@ -300,7 +300,7 @@ class Testbed(mod.Testbed): while max_waiting_time > 0 and over_processes < total_processes: # Check for errors if not error_queue.empty(): - print('Failure while shutting down: {}'.format(str(error_queue.get()))) + print('Failure while shutting down: %s' % str(error_queue.get())) over_processes += 1 try: # Check for results |