[ 
https://issues.apache.org/jira/browse/AMBARI-23469?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16769696#comment-16769696
 ] 

MARTIN GATTO commented on AMBARI-23469:
---------------------------------------

Hi, I have the same error. Im looking this ticket is not resolved.

context:
 * Python version:  Python 2.7.5
 * Ambari Repo: 

[root@master3 yum.repos.d]# vi ambari.repo 

 

#VERSION_NUMBER=2.7.3.0-139

[ambari-2.7.3.0]

#json.url = http://public-repo-1.hortonworks.com/HDP/hdp_urlinfo.json

name=ambari Version - ambari-2.7.3.0

baseurl=http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.7.3.0

gpgcheck=1

gpgkey=http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.7.3.0/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins

enabled=1

priority=1

 

 

I´m looking the HostCleanup.py script call another scripts that are not in the 
correct path. The script when try to import:
 * from AmbariConfig import AmbariConfig

does not work, because the script is using the path 
sys.path.append("/usr/lib/ambari-agent/lib/") but the "AmbariConfig.py" is 
located in 

/usr/lib/ambari-agent/lib/ambari_agent/AmbaryConfig.py" Whe you move this 
script to  /usr/lib/ambari-agent/lib/ the script  AmbariConfig.py for the line  
42: "from AmbariConfig import AmbariConfig" works fine, but the next error is 
for the same situation for the script hostname.py located in a wrong path. 

 

So, if you move the scripts:
 * /usr/lib/ambari-agent/lib/ambari_agent/ AmbariConfig.py to  
/usr/lib/ambari-agent/lib/

 * /usr/lib/ambari-agent/lib/ambari_agent/hostname.py to  
/usr/lib/ambari-agent/lib/

 

when you solve this issue moving the scripts, when I do the execution for the 
script "python /usr/lib/ambari-agent/lib/ambari_agent/HostCleanup.py --silent 
--skip=users"

the error is:

[root@master3 ambari_agent]# python 
/usr/lib/ambari-agent/lib/ambari_agent/HostCleanup.py --silent --skip=users

Traceback (most recent call last):

  File "/usr/lib/ambari-agent/lib/ambari_agent/HostCleanup.py", line 710, in 
<module>

    main()

  File "/usr/lib/ambari-agent/lib/ambari_agent/HostCleanup.py", line 701, in 
main

    h.do_cleanup(propMap)

  File "/usr/lib/ambari-agent/lib/ambari_agent/HostCleanup.py", line 144, in 
do_cleanup

    procList = proc_map.get(PROCESS_KEY)

AttributeError: 'NoneType' object has no attribute 'get'

 

Can help me to solve this problem?

tks

 

 

> HostCleanup.py script is failing with AttributeError: 'NoneType' object has 
> no attribute 'get'
> ----------------------------------------------------------------------------------------------
>
>                 Key: AMBARI-23469
>                 URL: https://issues.apache.org/jira/browse/AMBARI-23469
>             Project: Ambari
>          Issue Type: Bug
>          Components: ambari-agent
>    Affects Versions: trunk, 2.7.0
>            Reporter: JaySenSharma
>            Priority: Major
>
> - While running HostCleanup.pu on Ambari 2.7.0 then it fails with the 
> following error:
> {code}
> # /usr/lib/ambari-agent/lib/ambari_agent/HostCleanup.py  --silent --verbose
> Traceback (most recent call last):
>   File "/usr/lib/ambari-agent/lib/ambari_agent/HostCleanup.py", line 710, in 
> <module>
>     main()
>   File "/usr/lib/ambari-agent/lib/ambari_agent/HostCleanup.py", line 701, in 
> main
>     h.do_cleanup(propMap)
>   File "/usr/lib/ambari-agent/lib/ambari_agent/HostCleanup.py", line 144, in 
> do_cleanup
>     procList = proc_map.get(PROCESS_KEY)
> AttributeError: 'NoneType' object has no attribute 'get'
> {code}
> - Used Python version is:
> {code}
> # python --version
> Python 2.7.5
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to