Exemple #1
0
    def get_openstack_metadata(self, server, servers_config, key, filepath):
        """
        @summary:Returns openstack metadata on config drive
        @return: Response Object containing openstack meta domain object
        @rtype: Request Response Object
        """

        remote_client = self.server_behaviors.get_remote_instance_client(
            server, servers_config, key=key)
        openstack_meta_str = remote_client.get_file_details(file_path=filepath)
        return OpenStackMeta.deserialize(openstack_meta_str.content, 'json')
Exemple #2
0
    def get_openstack_metadata(self, server, servers_config, key,
                               filepath):
        """
        @summary:Returns openstack metadata on config drive
        @return: Response Object containing openstack meta domain object
        @rtype: Request Response Object
        """

        remote_client = self.server_behaviors.get_remote_instance_client(
            server, servers_config, key=key)
        openstack_meta_str = remote_client.get_file_details(
            file_path=filepath)
        return OpenStackMeta.deserialize(openstack_meta_str.content, 'json')
Exemple #3
0
    def get_config_drive_details(self, file_path, base_path_to_mount, server,
                                 server_config, private_key, filepath):
        """
        @summary:Returns user data, directory size and metadata
        @return: user data, directory details and metadata
        @rtype: String
        """

        remote_client = self.server_behaviors.get_remote_instance_client(
            server, server_config, key=private_key)
        self.user_data = remote_client.get_file_details(
            file_path=file_path).content
        self.kb_size = remote_client.get_directory_details(base_path_to_mount)
        self.openstack_meta = remote_client.get_file_details(
            file_path=filepath)
        return_values = (self.user_data, self.kb_size,
                         OpenStackMeta.deserialize(self.openstack_meta.content,
                                                   'json'))
        return return_values
Exemple #4
0
    def get_config_drive_details(self, file_path, base_path_to_mount, server,
                                 server_config, private_key, filepath):
        """
        @summary:Returns user data, directory size and metadata
        @return: user data, directory details and metadata
        @rtype: String
        """

        remote_client = self.server_behaviors.get_remote_instance_client(
            server, server_config, key=private_key)
        self.user_data = remote_client.get_file_details(
            file_path=file_path).content
        self.kb_size = remote_client.get_directory_details(base_path_to_mount)
        self.openstack_meta = remote_client.get_file_details(
            file_path=filepath)
        return_values = (
            self.user_data, self.kb_size,
            OpenStackMeta.deserialize(self.openstack_meta.content, 'json'))
        return return_values