Christian, you can first check if the "my-site" (or appropriate) section was 
included in the command-*.json file for that command, by checking inside 
/var/lib/ambari-agent/data
If it's not, then the config "my-site" needs to be a dependency inside the 
service's metainfo.xml file. Does it work when calling another service's 
config() method?
If the config is already in the dependency section of the metainfo.xml file, 
then try debugging the java side.

Thanks,
Alejandro

From: Christian Tzolov <[email protected]<mailto:[email protected]>>
Reply-To: "[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>
Date: Wednesday, July 22, 2015 at 9:12 AM
To: "[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>
Subject: Script.get_config() doesn't load the configuratoin files when run 
inside the master.py#status method

(i'd wrongly posted this question to the dev list instead of asking here - 
sorry for the noise)

Hi fellows,

I'm working on a simple Service extension for Ambari 1.7.

It looks like the Script.get_config() does not initialize the config files 
(e.g. my-site.xml) defined in the metainfo.xml, when the get_config is called 
inside the "status" method of the master script.

An attempt to access the config['configuration']['my-site'] inside the status 
method throws the following error:
>>> Configuration parameter \'my-site\' was not found in configurations 
>>> dictionary!'

But the same configuration properties are accessible inside the  "initialize", 
"start" and "stop" methods.

Is there something special for the 'status' method initialization or am i 
overlooking some important detail?

Would appreciate and ideas/advices. Also I can share the problem source code if 
needed

Thanks,
Christian

--
Christian Tzolov<http://www.linkedin.com/in/tzolov> | Solution Architect, EMEA 
Practice Team | Pivotal<http://pivotal.io/>
[email protected]<mailto:[email protected]>|+31610285517

Reply via email to