~ibmcharmers/charms/trusty/layer-ibm-dsm-enterprise/devel

« back to all changes in this revision

Viewing changes to reactive/ibm_dsm_enterprise.py

  • Committer: anitanayak at ibm
  • Date: 2017-03-15 09:29:46 UTC
  • Revision ID: anitanayak@in.ibm.com-20170315092946-nwfy04ra47ufkfnv
checking in after incorporated the review comments of default password and icon

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
    if not is_state('ibm-dsm-adminpassword.set'):
23
23
        config = hookenv.config()
24
24
        cfg_dsm_admin_password = config.get('dsm_admin_password')
 
25
        if cfg_dsm_admin_password == "":
 
26
            hookenv.status_set("blocked",
 
27
                               "IBM DSM: Provide dsm_admin_password")
 
28
            return 0
25
29
        try:
26
30
            file_admin_password_obj = open(file_admin_password, "w")
27
31
            file_admin_password_obj.write(cfg_dsm_admin_password)
28
32
            file_admin_password_obj.close()
29
33
            set_state('ibm-dsm-adminpassword.set')
30
 
            hookenv.log("packge_ibm_dsm_base: user "
 
34
            hookenv.log("packge_ibm_dsm_enterprise: user "
31
35
                        "admin password :" + cfg_dsm_admin_password)
32
36
        except subprocess.CalledProcessError as e:
33
37
            hookenv.log(e.output)
34
 
            hookenv.log("packge_ibm_dsm_base: user "
 
38
            hookenv.log("packge_ibm_dsm_enterprise: user "
35
39
                        "admin password unable to set")
 
40
            return 0
36
41
 
37
42
    if not (("ppc64le" in ARCHITECTURE) or ("x86_64" in ARCHITECTURE)):
38
43
        hookenv.log("packge_ibm_dsm_enterprise: "
41
46
                           'IBM DSM Enterprise: unsupported architecture')
42
47
        return 1
43
48
 
44
 
    if "x86_64"in ARCHITECTURE or "ppc64le" in ARCHITECTURE:
 
49
    if "x86_64" in ARCHITECTURE or "ppc64le" in ARCHITECTURE:
45
50
        if "x86_64" in ARCHITECTURE:
46
51
            hookenv.log("packge_ibm_dsm_enterprise: Architecture is x86_64")
47
52
        else: