Skip to content

Commit

Permalink
respond to review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ehankland committed Jun 24, 2015
1 parent 3b91e91 commit 39762d9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
3 changes: 2 additions & 1 deletion perfkitbenchmarker/benchmark_sets.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ def GetBenchmarksFromFlags():
if benchmark_name in valid_benchmarks:
benchmark_module_list.append(valid_benchmarks[benchmark_name])
else:
raise ValueError('Invalid benchmark %s' % benchmark_name)
raise ValueError('Benchmark "%s" not valid on os_type "%s"' %
(benchmark_name, FLAGS.os_type))

return benchmark_module_list
5 changes: 3 additions & 2 deletions perfkitbenchmarker/benchmark_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,9 @@ def CreateVirtualMachine(self, opt_zone=None):

vm_classes = CLASSES[self.cloud][VIRTUAL_MACHINE]
if FLAGS.os_type not in vm_classes:
raise errors.Error('The cloud "%s" does not support VMs of type "%s".' %
(self.cloud, FLAGS.os_type))
raise errors.Error(
'VMs of type %s" are not currently supported on cloud "%s".' %
(FLAGS.os_type, self.cloud))
vm_class = vm_classes[FLAGS.os_type]
zone = opt_zone or self.zones[0]
if zone not in self.networks:
Expand Down
10 changes: 6 additions & 4 deletions perfkitbenchmarker/windows_virtual_machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ def RemoteCopy(self, local_path, remote_path='', copy_to=True):
Raises:
RemoteCommandError: If there was a problem copying the file.
"""
if ':' in remote_path:
remote_path = remote_path.split(':', 1)[1]
drive, remote_path = os.path.splitdrive(remote_path)
drive = (drive or self.system_drive).rstrip(':')

set_error_pref = '$ErrorActionPreference="Stop"'

Expand All @@ -117,7 +117,7 @@ def RemoteCopy(self, local_path, remote_path='', copy_to=True):
'.PSCredential -argumentlist %s,$pw' % (password, self.user_name))

psdrive_name = self.name
root = '\\\\%s\\c$' % self.ip_address
root = '\\\\%s\\%s$' % (self.ip_address, drive)
create_psdrive = (
'New-PSDrive -Name %s -PSProvider filesystem -Root '
'%s -Credential $cred' % (psdrive_name, root))
Expand Down Expand Up @@ -156,6 +156,8 @@ def WaitForBootCompletion(self):
def OnStartup(self):
stdout, _ = self.RemoteCommand('echo $env:TEMP')
self.temp_dir = os.path.join(stdout.strip(), 'pkb')
stdout, _ = self.RemoteCommand('echo $env:SystemDrive')
self.system_drive = stdout.strip()
self.RemoteCommand('mkdir %s' % self.temp_dir)
self.DisableGuestFirewall()

Expand Down Expand Up @@ -183,7 +185,7 @@ def PackageCleanup(self):
for package_name in self._installed_packages:
self.Uninstall(package_name)
self.RemoteCommand('rm -recurse -force %s' % self.temp_dir)
self.DisableGuestFirewall()
self.EnableGuestFirewall()

def _GetNumCpus(self):
"""Returns the number of logical CPUs on the VM.
Expand Down

0 comments on commit 39762d9

Please sign in to comment.