This is an automatically generated e-mail. To reply, visit:

Review request for Ambari, Andrew Onischuk and Sumit Mohanty.

Bugs: AMBARI-18152

Repository: ambari


** Issue: **
AMBARI-15300 accesses *properties* in ServerConfigDefaults::__init__() in 
serverConfiguration.py even if get_ambari_properties() fails, resulting in an 
exception, since *properties* is *-1* on failure.

File "/usr/lib/python2.6/site-packages/ambari_server/serverConfiguration.py", 
line 349, in __init__
    self.PID_DIR = properties.get_property(PID_DIR_PROPERTY)
AttributeError: 'int' object has no attribute 'get_property'

** Fix: **
In get_ambari_properties():
1. Check if ROOT is available and then use it since this was the primary issue 
(key not found).
2. Read the properties file in its own block of code so that we still have 
access to the properties even if we are not able to replace $ROOT
3. In case of failure reading the properties file, use default properties in 
the caller.


  ambari-server/sbin/ambari-server 046ff4b3d40cdfde0d5aee52040d6996aefba08b 

Diff: https://reviews.apache.org/r/51123/diff/


** 1. mvn test -DskipSurefireTests **

Ran 267 tests in 6.698s

Total run:1120
Total errors:0
Total failures:0
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:09.411s
[INFO] Finished at: Mon Aug 15 17:48:50 PDT 2016
[INFO] Final Memory: 56M/835M
[INFO] ------------------------------------------------------------------------

** 2. Manual testing **
Deployed a VM with the latest build from **trunk** and replaced  
*serverConfiguration.py* with the one from the local build. Verified that 
*ambari-server.py --help* works as expected:

[root@c6401 /]# ambari-server.py --help
Usage: ambari-server.py [options] action [stack_id os]

  -h, --help            show this help message and exit
  -f INIT_SCRIPT_FILE, --init-script-file=INIT_SCRIPT_FILE
                        File with setup script
  -r DROP_SCRIPT_FILE, --drop-script-file=DROP_SCRIPT_FILE
                        File with drop script
                        File with upgrade script
                        File with stack upgrade script
  -j JAVA_HOME, --java-home=JAVA_HOME
                        Use specified java_home.  Must be valid on all hosts
  -v, --verbose         Print verbose status messages
  -s, --silent          Silently accepts default prompt values
  -g, --debug           Start ambari-server in debug mode
  -y, --suspend-start   Freeze ambari-server Java process at startup in debug
  --all                 LDAP sync all option.  Synchronize all LDAP users and
  --existing            LDAP sync existing option.  Synchronize existing
                        Ambari users and groups only.
                        LDAP sync users option. Specifies the path to a CSV
                        file of user names to be synchronized.
                        LDAP sync groups option.  Specifies the path to a CSV
                        file of group names to be synchronized.
  --database=DBMS       Database to use
                        Hostname of database server
                        Database port
                        Database/Service name or ServiceID
                        Postgres database schema name
                        Database user login
                        Database user password
                        Oracle database identifier type, Service ID/Service
                        Name sid|sname
                        SQL Anywhere server name
                        Specifies the path to the JDBC driver JAR file or
                        archive with all required files(jdbc jar, libraries
                        and etc), for the database type specified with the
                        --jdbc-db option. Used only with --jdbc-db option.
                        Archive is supported only for sqlanywhere database.
  --jdbc-db=JDBC_DB     Specifies the database type
                        [postgres|mysql|mssql|oracle|hsqldb|sqlanywhere] for
                        the JDBC driver specified with the --jdbc-driver
                        option. Used only with --jdbc-driver option.
                        Cluster name
                        Display name of desired repo version
                        Skip properties file validation
                        Skip database consistency check
  --force-version       Force version to current
                        Specify stack version that needs to be enabled. All
                        other stacks versions will be disabled
  --stack=STACK_NAME    Specify stack name for the stack versions that needs
                        to be enabled
                        Specify date for the cleanup process in 'yyyy-MM-dd'
  --mpack=MPACK_PATH    Specified the path for management pack to be
  --purge               Purge existing resources specified in purge-list
                        Comma separated list of resources to purge (stack-
                        definitions,service-definitions,mpacks). By default
                        (stack-definitions,mpacks) will be purged.
  --force               Force install management pack
  --ldap-url=LDAP_URL   Primary url for LDAP
                        Secondary url for LDAP
  --ldap-ssl=LDAP_SSL   Use SSL [true/false] for LDAP
                        User Attribute Object Class for LDAP
                        User Attribute Name for LDAP
                        Group Attribute Object Class for LDAP
                        Group Attribute Name for LDAP
                        Group Membership Attribute Name for LDAP
  --ldap-dn=LDAP_DN     Distinguished name attribute for LDAP
                        Base DN for LDAP
                        Manager DN for LDAP
                        Manager Password For LDAP
  --ldap-save-settings  Save without review for LDAP
                        Referral method [follow/ignore] for LDAP
                        Bind anonymously [true/false] for LDAP
                        Username for LDAP sync
                        Password for LDAP sync
                        Type of TrustStore (jks|jceks|pkcs12)
                        Path of TrustStore
                        Password for TrustStore
                        Force to reconfigure TrustStore if exits
                        Setup security option (setup-https|encrypt-password
  --api-ssl=API_SSL     Enable SSL for Ambari API [true/false]
                        Client API SSL port
                        Path to Certificate (import)
                        Alias for the imported certificate
                        Path to Private Key (import)
                        Password for Private Key
                        Master key for encrypting passwords
                        Persist master key [true/false]
                        Kerberos principal for ambari server
                        Keytab path for Kerberos principal


Nahappan Somasundaram

Reply via email to