def assign_keypair(self):
    self.stack_name = self._stack_rand_name()
    if CONF.orchestration.keypair_name:
        self.keypair = None
        self.keypair_name = CONF.orchestration.keypair_name
    else:
        self.keypair = self.create_keypair()
        self.keypair_name = self.keypair['name']
def assign_keypair(self):
    self.stack_name = self._stack_rand_name()
    if CONF.orchestration.keypair_name:
        self.keypair = None
        self.keypair_name = CONF.orchestration.keypair_name
    else:
        self.keypair = self.create_keypair()
        self.keypair_name = self.keypair['name']