ambari-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Varnau <steve.var...@esgyn.com>
Subject RE: why status can not use config['configurations']
Date Tue, 26 Jun 2018 15:45:22 GMT
Speaking as a novice, but it seems to me that you can write out the config value into a system
config file (/etc/<service>/conf/...) when installing the service, and then the status
function has to read the value from there.

--Steve

> -----Original Message-----
> From: Dai Xiang <xiang.dai@sky-data.cn>
> Sent: Monday, June 25, 2018 6:21 PM
> To: dev@ambari.apache.org
> Subject: Re: why status can not use config['configurations']
> 
> On Mon, Jun 25, 2018 at 08:59:31AM -0500, David Quiroga wrote:
> > If possible can you share more code. Hard to understand what is going on.
> > Are you modifying an existing script or creating a custom one?
> 
> I want to create a custom service and in status function, i want to
> read config when install which is as
> config['configurations']['ntpd']['deploy'].
> 
> In install/start/stop function, this val can be got as expected,
> but in status function can not, i tried to print it and it output
> "agentConfigParams".
> 
> So how can i get config when install?
> 
> >
> > On Mon, Jun 25, 2018 at 3:01 AM, <xiang.dai@sky-data.cn> wrote:
> >
> > > Hi!
> > >
> > > config = Script.get_config()
> > > Then I want to use config['configurations']['ntpd']['deploy'] in status
> > > function, but it says:
> > >
> > > Fail: Configuration parameter 'ntpd' was not found in configurations
> > > dictionary!
> > >
> > > I also use config['configurations']['ntpd']['deploy'] in start and stop
> > > function, both ok.
> > >
> > > And i try to print config in status funtion, it only prints
> > > agentConfigParams.
> > >
> > > So how can i use config['configurations']['ntpd']['deploy']?
> > >
> > > Thanks.
> > >
> > >
> > >
> > >
> 
> --
> Best Regards
> Dai Xiang

Mime
View raw message