summaryrefslogtreecommitdiffstats
path: root/glustolibs-gluster/glustolibs/gluster/gluster_base_class.py
diff options
context:
space:
mode:
Diffstat (limited to 'glustolibs-gluster/glustolibs/gluster/gluster_base_class.py')
-rw-r--r--glustolibs-gluster/glustolibs/gluster/gluster_base_class.py148
1 files changed, 74 insertions, 74 deletions
diff --git a/glustolibs-gluster/glustolibs/gluster/gluster_base_class.py b/glustolibs-gluster/glustolibs/gluster/gluster_base_class.py
index d5864c0..73a6c4c 100644
--- a/glustolibs-gluster/glustolibs/gluster/gluster_base_class.py
+++ b/glustolibs-gluster/glustolibs/gluster/gluster_base_class.py
@@ -1202,83 +1202,83 @@ class GlusterBlockBaseClass(GlusterBaseClass):
"""
# Get gluster block info from config file
if g.config.get('gluster_block_args_info'):
- cls.gluster_block_args_info = {}
- blocks_count = 0
- each_block_info = g.config['gluster_block_args_info']
+ cls.gluster_block_args_info = {}
+ blocks_count = 0
+ each_block_info = g.config['gluster_block_args_info']
# for i, each_block_info in enumerate(
# g.config['gluster_block_args_info']):
# volname
- block_on_volume = cls.volname
- if each_block_info.get('volname'):
- block_on_volume = each_block_info['volname']
-
- # Block name
- block_base_name = "gluster_block"
- if each_block_info.get('blockname'):
- block_base_name = each_block_info['blockname']
-
- # servers
- block_servers = cls.servers
- if each_block_info.get('servers'):
- block_servers = each_block_info['servers']
- if not filter(None, block_servers):
- block_servers = cls.servers
-
- # Block size
- block_size = "1GiB"
- if each_block_info.get('size'):
- block_size = each_block_info['size']
-
- # HA
- block_ha = 3
- if each_block_info.get('ha'):
- block_ha = each_block_info['ha']
-
- # auth
- block_auth = None
- if each_block_info.get('auth'):
- block_auth = each_block_info['auth']
-
- # prealloc
- block_prealloc = None
- if each_block_info.get('prealloc'):
- block_prealloc = each_block_info['prealloc']
-
- # ring-buffer
- block_ring_buffer = None
- if each_block_info.get('ring-buffer'):
- block_ring_buffer = each_block_info['ring-buffer']
-
- # Number of blocks
- num_of_blocks = 1
- if each_block_info.get('num_of_blocks'):
- num_of_blocks = int(each_block_info['num_of_blocks'])
-
- # for count in range(blocks_count,num_of_blocks +blocks_count):
- for count in range(blocks_count, num_of_blocks):
- # blocks_count = int(count) + i
-
- if block_ha:
- selected_block_servers = random.sample(block_servers,
- block_ha)
- else:
- selected_block_servers = random.choice(block_servers)
-
- block_name = "_".join([block_base_name,
- str(count + 1)])
-
- cls.gluster_block_args_info[block_name] = (
- {'volname': block_on_volume,
- 'blockname': block_name,
- 'servers': cls.get_ip_from_hostname(
- selected_block_servers),
- 'size': block_size,
- 'ha': block_ha,
- 'auth': block_auth,
- 'prealloc': block_prealloc,
- 'storage': None,
- 'ring-buffer': block_ring_buffer}
- )
+ block_on_volume = cls.volname
+ if each_block_info.get('volname'):
+ block_on_volume = each_block_info['volname']
+
+ # Block name
+ block_base_name = "gluster_block"
+ if each_block_info.get('blockname'):
+ block_base_name = each_block_info['blockname']
+
+ # servers
+ block_servers = cls.servers
+ if each_block_info.get('servers'):
+ block_servers = each_block_info['servers']
+ if not filter(None, block_servers):
+ block_servers = cls.servers
+
+ # Block size
+ block_size = "1GiB"
+ if each_block_info.get('size'):
+ block_size = each_block_info['size']
+
+ # HA
+ block_ha = 3
+ if each_block_info.get('ha'):
+ block_ha = each_block_info['ha']
+
+ # auth
+ block_auth = None
+ if each_block_info.get('auth'):
+ block_auth = each_block_info['auth']
+
+ # prealloc
+ block_prealloc = None
+ if each_block_info.get('prealloc'):
+ block_prealloc = each_block_info['prealloc']
+
+ # ring-buffer
+ block_ring_buffer = None
+ if each_block_info.get('ring-buffer'):
+ block_ring_buffer = each_block_info['ring-buffer']
+
+ # Number of blocks
+ num_of_blocks = 1
+ if each_block_info.get('num_of_blocks'):
+ num_of_blocks = int(each_block_info['num_of_blocks'])
+
+ # for count in range(blocks_count,num_of_blocks +blocks_count):
+ for count in range(blocks_count, num_of_blocks):
+ # blocks_count = int(count) + i
+
+ if block_ha:
+ selected_block_servers = random.sample(block_servers,
+ block_ha)
+ else:
+ selected_block_servers = random.choice(block_servers)
+
+ block_name = "_".join([block_base_name,
+ str(count + 1)])
+
+ cls.gluster_block_args_info[block_name] = (
+ {'volname': block_on_volume,
+ 'blockname': block_name,
+ 'servers': cls.get_ip_from_hostname(
+ selected_block_servers),
+ 'size': block_size,
+ 'ha': block_ha,
+ 'auth': block_auth,
+ 'prealloc': block_prealloc,
+ 'storage': None,
+ 'ring-buffer': block_ring_buffer}
+ )
for key in cls.gluster_block_args_info.keys():
value = cls.gluster_block_args_info[key]