ambari-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonathan Hurley <>
Subject Re: Ambari - Trouble Checking Status for Custom Application
Date Mon, 18 Apr 2016 13:04:53 GMT
What are your import statements? The "format" function provided by Ambari's common library
has a naming conflict with a default python function named "format". If you don't import the
right one, your format("...") command will fail silently. Make sure you are importing:

from resource_management.libraries.functions.format import format

On Apr 18, 2016, at 4:27 AM, Souvik Sarkhel <<>>

Hi All,

I have created a custom service for Zookeeper and using Ambari 2.1.0 .In status function of if its defined in this way:
def status(self, env):
        config = Script.get_config()
        zkDataDir = config['configurations']['zoo']['dataDir']
        print 'Status of the Zookeeper Master'
        print *****************************************
        print zkDataDir
        dummy_master_pid_file = format("{zkDataDir}/")

Ambari is always showing status of application stopped but when I provide the constant path
of the pid file for example:

dummy_master_pid_file = "/usr/share/zookeeper/tmp/")

it starts working perfectly and Ambari is able to correctly show the status of the application.
I need a variable pid file instead of a constant one. I would to thankful if someone suggest
me a way out.

Thanking you in advance

Souvik Sarkhel

View raw message