Thanks Bhuvnesh, I was actually already doing something similar to what you suggested:
has_knox = 'topology' in config['configurations’] I was hoping there was a way that felt less hackish. Regards, Christopher Jackson > On Dec 9, 2015, at 5:37 PM, Bhuvnesh Chaudhary <[email protected]> wrote: > > Hello Christopher, > > You can check the key clusterHostInfo and examine its content if they have > any component for Knox (knox_gateway_hosts). In params.py you can probably > use the below. > config = Script.get_config() > config['clusterHostInfo'] > > Example of config['clusterHostInfo'] with knox during start of the component. > > {'snamenode_host': ['c6402.ambari.apache.org > <http://c6402.ambari.apache.org/>'], 'nm_hosts': ['c6402.ambari.apache.org > <http://c6402.ambari.apache.org/>', 'c6403.ambari.apache.org > <http://c6403.ambari.apache.org/>', 'c6401.ambari.apache.org > <http://c6401.ambari.apache.org/>'], 'app_timeline_server_hosts': > ['c6402.ambari.apache.org <http://c6402.ambari.apache.org/>'], > 'hawqsegment_hosts': ['c6401.ambari.apache.org > <http://c6401.ambari.apache.org/>'], 'all_ping_ports': ['8670', '8670', > '8670'], 'rm_host': ['c6402.ambari.apache.org > <http://c6402.ambari.apache.org/>', 'c6401.ambari.apache.org > <http://c6401.ambari.apache.org/>'], 'all_hosts': ['c6402.ambari.apache.org > <http://c6402.ambari.apache.org/>', 'c6403.ambari.apache.org > <http://c6403.ambari.apache.org/>', 'c6401.ambari.apache.org > <http://c6401.ambari.apache.org/>'], 'slave_hosts': ['c6402.ambari.apache.org > <http://c6402.ambari.apache.org/>', 'c6403.ambari.apache.org > <http://c6403.ambari.apache.org/>', 'c6401.ambari.apache.org > <http://c6401.ambari.apache.org/>'], 'all_racks': ['/default-rack', > '/default-rack', '/default-rack'], 'all_ipv4_ips': ['192.168.64.102', > '192.168.64.103', '192.168.64.101'], 'hs_host': ['c6402.ambari.apache.org > <http://c6402.ambari.apache.org/>'], 'knox_gateway_hosts': > ['c6401.ambari.apache.org <http://c6401.ambari.apache.org/>'], > 'hawqmaster_hosts': ['c6403.ambari.apache.org > <http://c6403.ambari.apache.org/>'], 'namenode_host': > ['c6401.ambari.apache.org <http://c6401.ambari.apache.org/>'], 'pxf_hosts': > ['c6402.ambari.apache.org <http://c6402.ambari.apache.org/>', > 'c6403.ambari.apache.org <http://c6403.ambari.apache.org/>', > 'c6401.ambari.apache.org <http://c6401.ambari.apache.org/>'], > 'ambari_server_host': ['c6401.ambari.apache.org > <http://c6401.ambari.apache.org/>'], 'zookeeper_hosts': > ['c6402.ambari.apache.org <http://c6402.ambari.apache.org/>', > 'c6403.ambari.apache.org <http://c6403.ambari.apache.org/>', > 'c6401.ambari.apache.org <http://c6401.ambari.apache.org/>'], > 'hawqstandby_hosts': ['c6402.ambari.apache.org > <http://c6402.ambari.apache.org/>']} > > Thanks, > Bhuvnesh Chaudhary > Email: bchau <mailto:[email protected]>[email protected] > <mailto:[email protected]> > Desk: +1-650-846-1696 | Mobile: +1-973-906-6976 > > On Wed, Dec 9, 2015 at 12:53 PM, Christopher Jackson > <[email protected] > <mailto:[email protected]>> wrote: > Hi All, > > Does the core ambari.resource.management python scripts provide any mechanism > for checking if a given service is installed? For instance how would I go > about setting a flag whether or not Knox is installed in the params.py file > for a custom service? > > Regards, > Christopher Jackson >
