Browse Source

Python 3 compatibility fixes

Fixes on MapR plugin to fit python3 compatibility.

Story: #2005902
Task: #36069
Change-Id: Ibc9f517425b05d5e22718b0f1581c33d8b436f21
(cherry picked from commit 8905dd368e)
changes/66/679466/1
Telles Nobrega 4 weeks ago
parent
commit
ee926298ea

+ 2
- 3
sahara_plugin_mapr/plugins/mapr/base/base_node_manager.py View File

@@ -77,9 +77,8 @@ class BaseNodeManager(s.AbstractNodeManager):
77 77
         instances = instances or cluster_context.get_instances()
78 78
         zookeepers = cluster_context.filter_instances(instances, mng.ZOOKEEPER)
79 79
         cldbs = cluster_context.filter_instances(instances, mfs.CLDB)
80
-        others = filter(
81
-            lambda i: not cluster_context.check_for_process(i, mfs.CLDB),
82
-            instances)
80
+        others = [i for i in instances
81
+                  if not cluster_context.check_for_process(i, mfs.CLDB)]
83 82
         utils.add_provisioning_step(cluster_context.cluster.id,
84 83
                                     _("Start ZooKeepers nodes"),
85 84
                                     len(zookeepers))

+ 1
- 1
sahara_plugin_mapr/plugins/mapr/services/oozie/oozie.py View File

@@ -135,7 +135,7 @@ class Oozie(s.Service):
135 135
 
136 136
     @el.provision_step(_("Rebuilt Oozie war"))
137 137
     def _rebuild(self, cluster_context, instances):
138
-        OOZIE.stop(filter(OOZIE.is_started, instances))
138
+        OOZIE.stop(list(filter(OOZIE.is_started, instances)))
139 139
         g.execute_on_instances(
140 140
             instances, self._rebuild_oozie_war, cluster_context)
141 141
         OOZIE.start(instances)

+ 1
- 1
sahara_plugin_mapr/plugins/mapr/services/swift/swift.py View File

@@ -46,7 +46,7 @@ class Swift(s.Service):
46 46
     @el.provision_step("Install Swift service")
47 47
     def _install_swift_jar(self, cluster_context, instances):
48 48
         LOG.debug('Installing Swift jar')
49
-        jar = u.get_file_text(Swift.HADOOP_SWIFT_JAR, 'sahara_plugin_mapr')
49
+        jar = u.try_get_file_text(Swift.HADOOP_SWIFT_JAR, 'sahara_plugin_mapr')
50 50
         path = '%s/swift.jar' % cluster_context.hadoop_lib
51 51
 
52 52
         @el.provision_event()

+ 4
- 4
sahara_plugin_mapr/plugins/mapr/util/validation_utils.py View File

@@ -233,10 +233,10 @@ def create_fake_cluster(cluster, existing, additional):
233 233
     def need_upd(node_group):
234 234
         return node_group.id in counts and counts[node_group.id] > 0
235 235
 
236
-    updated = map(update_ng, filter(need_upd, cluster.node_groups))
237
-    not_updated = filter(lambda ng:
238
-                         not need_upd(ng) and ng is not None,
239
-                         cluster.node_groups)
236
+    updated = list(map(update_ng, filter(need_upd, cluster.node_groups)))
237
+    not_updated = list(
238
+        filter(lambda ng: not need_upd(ng) and ng is not None,
239
+               cluster.node_groups))
240 240
     cluster_dict = cluster.to_dict()
241 241
     cluster_dict.update({'node_groups': updated + not_updated})
242 242
     fake = r.create_cluster_resource(cluster_dict)

Loading…
Cancel
Save