Browse Source

AMBARI-5783. Pig fails to install through bluprint. (Arsen Babych via swagle)

Siddharth Wagle 11 years ago
parent
commit
81173e14dd

+ 2 - 3
ambari-server/src/main/resources/stacks/HDP/2.0.6/services/PIG/package/scripts/params.py

@@ -43,9 +43,8 @@ hadoop_home = "/usr"
 if (('pig-properties' in config['configurations']) and ('pig-content' in config['configurations']['pig-properties'])):
   pig_properties = config['configurations']['pig-properties']['pig-content']
 else:
-  pig_properties = {}
-  pig_properties['hcat.bin'] = '/usr/bin/hcat'
-  pig_properties['pig.location.check.strict'] = 'false'
+  pig_properties = """hcat.bin=/usr/bin/hcat
+pig.location.check.strict=false"""
 
 # log4j.properties
 if (('pig-log4j' in config['configurations']) and ('content' in config['configurations']['pig-log4j'])):

+ 6 - 5
ambari-server/src/main/resources/stacks/HDP/2.0.6/services/PIG/package/scripts/pig.py

@@ -33,11 +33,12 @@ def pig():
   pig_TemplateConfig( ['pig-env.sh'])
 
   # pig_properties is always set to a default even if it's not in the payload
-  PropertiesFile(format("{params.pig_conf_dir}/pig.properties"),    
-    mode = 0644,
-    group=params.user_group,
-    owner=params.hdfs_user,
-    properties=params.pig_properties)    
+  File(format("{params.pig_conf_dir}/pig.properties"),
+              mode=0644,
+              group=params.user_group,
+              owner=params.hdfs_user,
+              content=params.pig_properties
+  )
 
   if (params.log4j_props != None):
     File(format("{params.pig_conf_dir}/log4j.properties"),

+ 4 - 4
ambari-server/src/test/python/stacks/2.0.6/PIG/test_pig_client.py

@@ -36,11 +36,11 @@ class TestPigClient(RMFTestCase):
     self.assertResourceCalled('TemplateConfig', '/etc/pig/conf/pig-env.sh',
       owner = 'hdfs'
     )
-    self.assertResourceCalled('PropertiesFile', '/etc/pig/conf/pig.properties',
+    self.assertResourceCalled('File', '/etc/pig/conf/pig.properties',
       owner = 'hdfs',
       group = 'hadoop',
       mode = 0644,
-      properties = 'pigproperties\nline2'      
+      content = 'pigproperties\nline2'
     )
     self.assertResourceCalled('File', '/etc/pig/conf/log4j.properties',
       owner = 'hdfs',
@@ -64,11 +64,11 @@ class TestPigClient(RMFTestCase):
     self.assertResourceCalled('TemplateConfig', '/etc/pig/conf/pig-env.sh',
       owner = 'hdfs'
     )
-    self.assertResourceCalled('PropertiesFile', '/etc/pig/conf/pig.properties',
+    self.assertResourceCalled('File', '/etc/pig/conf/pig.properties',
       owner = 'hdfs',
       group = 'hadoop',
       mode = 0644,
-      properties = 'pigproperties\nline2'
+      content = 'pigproperties\nline2'
     )
     self.assertResourceCalled('File', '/etc/pig/conf/log4j.properties',
       owner = 'hdfs',