0d646d103590b367c28d1e9588edca610b361e1f,perfkitbenchmarker/providers/rackspace/rackspace_virtual_machine.py,RackspaceVirtualMachine,AddMetadata,#RackspaceVirtualMachine#,376
Before Change
Adds metadata to the Rackspace VM
if not kwargs:
return
env = os.environ.copy()
env.update(util.GetDefaultRackspaceNovaEnv(self.zone))
cmd = [FLAGS.nova_path, "meta", self.id, "set"]
for key, value in kwargs.iteritems():
cmd.append("{0}={1}".format(key, value))
vm_util.IssueCommand(cmd, env=env)
class DebianBasedRackspaceVirtualMachine(RackspaceVirtualMachine,
linux_virtual_machine.DebianMixin):
After Change
raise errors.Resource.RetryableDeletionError(
"VM: %s has not been deleted. Retrying to check status." % self.name)
def AddMetadata(self, **kwargs):
Adds metadata to the VM via RackCLI update-metadata command.
if not kwargs:
return
cmd = util.RackCLICommand(self, "servers", "instance", "update-metadata")
cmd.flags["id"] = self.id
cmd.flags["metadata"] = ",".join("{0}={1}".format(key, value)
for key, value in kwargs.iteritems())
cmd.Issue()
def OnStartup(self):
Executes commands on the VM immediately after it has booted.
super(RackspaceVirtualMachine, self).OnStartup()
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 19
Instances
Project Name: GoogleCloudPlatform/PerfKitBenchmarker
Commit Name: 0d646d103590b367c28d1e9588edca610b361e1f
Time: 2016-02-12
Author: carlos.torres@rackspace.com
File Name: perfkitbenchmarker/providers/rackspace/rackspace_virtual_machine.py
Class Name: RackspaceVirtualMachine
Method Name: AddMetadata
Project Name: GoogleCloudPlatform/PerfKitBenchmarker
Commit Name: 0d646d103590b367c28d1e9588edca610b361e1f
Time: 2016-02-12
Author: carlos.torres@rackspace.com
File Name: perfkitbenchmarker/providers/rackspace/rackspace_disk.py
Class Name: RackspaceRemoteDisk
Method Name: _Create
Project Name: GoogleCloudPlatform/PerfKitBenchmarker
Commit Name: 0d646d103590b367c28d1e9588edca610b361e1f
Time: 2016-02-12
Author: carlos.torres@rackspace.com
File Name: perfkitbenchmarker/providers/rackspace/rackspace_virtual_machine.py
Class Name: RackspaceVirtualMachine
Method Name: AddMetadata
Project Name: GoogleCloudPlatform/PerfKitBenchmarker
Commit Name: 0d646d103590b367c28d1e9588edca610b361e1f
Time: 2016-02-12
Author: carlos.torres@rackspace.com
File Name: perfkitbenchmarker/providers/rackspace/rackspace_virtual_machine.py
Class Name: RackspaceVirtualMachine
Method Name: _Exists