diff --git a/simple_vm_client/openstack_connector/openstack_connector.py b/simple_vm_client/openstack_connector/openstack_connector.py index 5a88542..e1890fa 100644 --- a/simple_vm_client/openstack_connector/openstack_connector.py +++ b/simple_vm_client/openstack_connector/openstack_connector.py @@ -1163,17 +1163,24 @@ def create_userdata( new_volumes=volume_ids_path_new, attach_volumes=volume_ids_path_attach, ) + if additional_keys: if init_script: add_key_script = self.create_add_keys_script(keys=additional_keys) init_script = ( add_key_script + encodeutils.safe_encode("\n".encode("utf-8")) + + init_script ) else: init_script = self.create_add_keys_script(keys=additional_keys) + unlock_ubuntu_user_script = "\npasswd -u ubuntu\n" + unlock_ubuntu_user_script = encodeutils.safe_encode( + unlock_ubuntu_user_script.encode("utf-8") + ) + init_script = init_script + unlock_ubuntu_user_script return init_script def start_server(