def test_get_swift_lib_url(self): cluster = ctu.get_fake_cluster(cluster_configs={}) self.assertEqual(c_h.DEFAULT_SWIFT_LIB_URL, c_h.get_swift_lib_url(cluster)) cluster = ctu.get_fake_cluster( cluster_configs={'general': {c_h.SWIFT_LIB_URL.name: 'spam'}}) self.assertEqual('spam', c_h.get_swift_lib_url(cluster))
def test_get_swift_lib_url(self): cluster = ctu.get_fake_cluster(cluster_configs={}) self.assertEqual(c_h.DEFAULT_SWIFT_LIB_URL, c_h.get_swift_lib_url(cluster)) cluster = ctu.get_fake_cluster( cluster_configs={'general': { c_h.SWIFT_LIB_URL.name: 'spam' }}) self.assertEqual('spam', c_h.get_swift_lib_url(cluster))
def _configure_swift_to_inst(instance): cluster = instance.node_group.cluster with instance.remote() as r: r.execute_command('sudo curl %s -o %s/hadoop-openstack.jar' % ( c_helper.get_swift_lib_url(cluster), HADOOP_LIB_DIR)) core_site = r.read_file_from(PATH_TO_CORE_SITE_XML) configs = xmlutils.parse_hadoop_xml_with_name_and_value(core_site) configs.extend(swift_helper.get_swift_configs()) confs = dict((c['name'], c['value']) for c in configs) new_core_site = xmlutils.create_hadoop_xml(confs) r.write_file_to(PATH_TO_CORE_SITE_XML, new_core_site, run_as_root=True)
def _configure_swift_to_inst(instance): cluster = instance.node_group.cluster with instance.remote() as r: r.execute_command( 'sudo curl %s -o %s/hadoop-openstack.jar' % (c_helper.get_swift_lib_url(cluster), HADOOP_LIB_DIR)) core_site = r.read_file_from(PATH_TO_CORE_SITE_XML) configs = xmlutils.parse_hadoop_xml_with_name_and_value(core_site) configs.extend(swift_helper.get_swift_configs()) confs = dict((c['name'], c['value']) for c in configs) new_core_site = xmlutils.create_hadoop_xml(confs) r.write_file_to(PATH_TO_CORE_SITE_XML, new_core_site, run_as_root=True)
def _configure_swift_to_inst(instance): cluster = instance.node_group.cluster with instance.remote() as r: r.execute_command( 'sudo curl %s -o %s/hadoop-openstack.jar' % (c_helper.get_swift_lib_url(cluster), HADOOP_LIB_DIR))
def _configure_swift_to_inst(instance): cluster = instance.node_group.cluster with instance.remote() as r: r.execute_command('sudo curl %s -o %s/hadoop-openstack.jar' % ( c_helper.get_swift_lib_url(cluster), HADOOP_LIB_DIR))