ctubbsii commented on a change in pull request #270: Support Accumulo installs
on Microsoft Azure
URL: https://github.com/apache/fluo-muchos/pull/270#discussion_r318752743
##########
File path: lib/muchos/config.py
##########
@@ -137,17 +141,27 @@ def force_format(self):
return 'no'
return retval
- def worker_data_dirs(self):
+ def data_dirs_common(self, nodeType):
+ data_dirs = []
+
if self.get_cluster_type() == 'ec2':
- return self.node_type_map()['worker']['mounts']
+ data_dirs = self.node_type_map()[nodeType]['mounts']
elif self.get_cluster_type() == 'existing':
- return self.get('existing', 'data_dirs').split(",")
+ data_dirs = self.get('existing', 'data_dirs').split(",")
+ elif self.get_cluster_type() == 'azure':
+ num_disks = int(self.get("azure","numdisks"))
+ range_var = num_disks + 1
+ for diskNum in range(1, range_var):
+ data_dirs.append(self.get("azure","mount_root") + str(diskNum))
+
+
+ return data_dirs
+
+ def worker_data_dirs(self):
+ return self.data_dirs_common("worker")
def default_data_dirs(self):
- if self.get_cluster_type() == 'ec2':
- return self.node_type_map()['default']['mounts']
- elif self.get_cluster_type() == 'existing':
- return self.get('existing', 'data_dirs').split(",")
+ return self.data_dirs_common("default")
Review comment:
Nice removal of duplicate/boilerplate code.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services