ambari-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alejandro Fernandez <afernan...@hortonworks.com>
Subject Re: Script.get_config() doesn't load the configuratoin files when run inside the master.py#status method
Date Wed, 22 Jul 2015 18:30:29 GMT
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 <ctzolov@pivotal.io<mailto:ctzolov@pivotal.io>>
Reply-To: "user@ambari.apache.org<mailto:user@ambari.apache.org>" <user@ambari.apache.org<mailto:user@ambari.apache.org>>
Date: Wednesday, July 22, 2015 at 9:12 AM
To: "user@ambari.apache.org<mailto:user@ambari.apache.org>" <user@ambari.apache.org<mailto:user@ambari.apache.org>>
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/>
ctzolov@pivotal.io<mailto:ctzolov@pivotal.io>|+31610285517

Mime
View raw message