"There was a problem while retrieving machine_type"
" information from the cloud provider.")
def CreateKeyPair(self):
Imports the public keyfile to Rackspace.
with open(self.ssh_public_key) as f:
public_key = f.read().rstrip("\n")
with tempfile.NamedTemporaryFile(dir=vm_util.GetTempDir(),
prefix="key-metadata") as tf:
tf.write("%s\n" % public_key)
tf.flush()
env = os.environ.copy()env.update(util.GetDefaultRackspaceNovaEnv(self.zone))
key_cmd = [
FLAGS.nova_path, "keypair-add",
"--pub-key", tf.name, self.key_name]
vm_util.IssueRetryableCommand(key_cmd, env=env)