Exemplo n.º 1
0
    def __init__(self, fpath=FLAGS.server_manifest, is_server_manifest=True):
        """Set the file path, and which file to parser."""

        # Define two lists below. _disk_type_list need two columns.
        # _single_type_list need just one column.

        #self._disk_type_list = ['ssd', '7200_rpm_sata', '10krpm_sas',
        #       'ssd_cached_7200rpm_sata', 'ssd_cached_10krpm_sas']

        self._context = context.get_admin_context()
        #self._disk_type_list = self._get_disk_type_list()
        self._single_type_list = ['vsm_controller_ip', 'role']

        # Sections in cluster.manifest
        self._cluster_names = [
            'storage_class',
            'storage_group',
            'cluster',
            'file_system',
            'management_addr',
            'ceph_public_addr',
            'ceph_cluster_addr',
            'storage_group_near_full_threshold',
            'storage_group_full_threshold',
            'ceph_near_full_threshold',
            #'osd_heartbeat_interval',
            #'osd_heartbeat_grace',
            'ceph_full_threshold'
        ]

        self._is_server_manifest = is_server_manifest
        self._file_path = fpath
        if not fpath:
            self._file_path = FLAGS.server_manifest

        if is_server_manifest == False:
            self._file_path = fpath or FLAGS.cluster_manifest

        if not os.path.exists(self._file_path):
            sys_info.wait_disk_ready(self._file_path)
        self._lines = None
        self._read_lines()
        self._check_key_words_exists()
        self._name_dicts = {}
        self._map = {}
Exemplo n.º 2
0
    def __init__(self, fpath=FLAGS.server_manifest, is_server_manifest=True):
        """Set the file path, and which file to parser."""

        # Define two lists below. _disk_type_list need two columns.
        # _single_type_list need just one column.

        # self._disk_type_list = ['ssd', '7200_rpm_sata', '10krpm_sas',
        #       'ssd_cached_7200rpm_sata', 'ssd_cached_10krpm_sas']

        self._context = context.get_admin_context()
        # self._disk_type_list = self._get_disk_type_list()
        self._single_type_list = ["vsm_controller_ip", "role"]

        # Sections in cluster.manifest
        self._cluster_names = [
            "storage_class",
            "storage_group",
            "cluster",
            "file_system",
            "management_addr",
            "ceph_public_addr",
            "ceph_cluster_addr",
            "storage_group_near_full_threshold",
            "storage_group_full_threshold",
            "ceph_near_full_threshold",
            #'osd_heartbeat_interval',
            #'osd_heartbeat_grace',
            "ceph_full_threshold",
        ]

        self._is_server_manifest = is_server_manifest
        self._file_path = fpath
        if not fpath:
            self._file_path = FLAGS.server_manifest

        if is_server_manifest == False:
            self._file_path = fpath or FLAGS.cluster_manifest

        if not os.path.exists(self._file_path):
            sys_info.wait_disk_ready(self._file_path)
        self._lines = None
        self._read_lines()
        self._check_key_words_exists()
        self._name_dicts = {}
        self._map = {}