python2.6 setup.py build

Asked by shihangwei

# python2.6 setup.py build
No handlers could be found for logger "nova.root"

http://nova.openstack.org/adminguide/single.node.install.html#step-11-get-an-image

Question information

Language:
English Edit question
Status:
Solved
For:
OpenStack Compute (nova) Edit question
Assignee:
No assignee Edit question
Solved by:
shihangwei
Solved:
Last query:
Last reply:

This question was reopened

Revision history for this message
Vasiliy Shlykov (vash-vasiliyshlykov) said :
#1

As workaround I recommend you add this line:
logging.baseConfig()
to setup.py just after import code.

Revision history for this message
janson (janson071) said :
#2

To: Vasiliy Shlykov
after adding logging.baseConfig() to setup.py,
there is an error as follows:
[root@localhost nova-2011.1]# python2.6 setup.py build
Traceback (most recent call last):
  File "setup.py", line 21, in <module>
    logging.baseConfig()
NameError: name 'logging' is not defined

what I add as follows:

import os
import subprocess
logging.baseConfig()

Is it right ?

Revision history for this message
Vasiliy Shlykov (vash-vasiliyshlykov) said :
#3

Ups, I forgot to import logging. This is the right workaround:

import logging
logging.basicConfig()

Revision history for this message
shihangwei (shihangwei) said :
#4

To Vasiliy Shlykov ,
: (
i did it :

import logging
logging.basicConfig()

but it is also :
No handlers could be found for logger "nova.root"

OMG

Revision history for this message
Vasiliy Shlykov (vash-vasiliyshlykov) said :
#5

Anyway, beginning of my setup.py, hope this helps:

import os
import subprocess
import logging

from setuptools import setup, find_packages
from setuptools.command.sdist import sdist

from nova.utils import parse_mailmap, str_dict_replace
from nova import version

logging.basicConfig()

if os.path.isdir('.bzr'):

Revision history for this message
shihangwei (shihangwei) said :
#6

also is
No handlers could be found for logger "nova.root"

it is fate ? =。=

Revision history for this message
janson (janson071) said :
#7

The result is the same to me,
Is there any other solution ?
Appreciaed for your quick reply!

Revision history for this message
shihangwei (shihangwei) said :
#8

also is
No handlers could be found for logger "nova.root"

Revision history for this message
Vish Ishaya (vishvananda) said :
#9

the commands should actually be:

from nova import log as logging
logging.basicConfig()

On Feb 14, 2011, at 2:59 AM, shihangwei wrote:

> Question #145300 on OpenStack Compute (nova) changed:
> https://answers.launchpad.net/nova/+question/145300
>
> Status: Solved => Open
>
> shihangwei is still having a problem:
> also is
> No handlers could be found for logger "nova.root"
>
> --
> You received this question notification because you are a member of Nova
> Core, which is an answer contact for OpenStack Compute (nova).

Revision history for this message
shihangwei (shihangwei) said :
#10

hello,Vish
i added it like this:

import os
import subprocess
from nova import log as logging
logging.basicConfig()
from setuptools import setup, find_packages
from setuptools.command.sdist import sdist
from nova.utils import parse_mailmap, str_dict_replace
from nova import version
if os.path.isdir('.bzr'):

and new error : ( ,as follows:

2011-02-15 08:44:41,544 CRITICAL nova.root [-] No module named netaddr
(nova.root): TRACE: Traceback (most recent call last):
(nova.root): TRACE: File "setup.py", line 29, in <module>
(nova.root): TRACE: from nova.utils import parse_mailmap, str_dict_replace
(nova.root): TRACE: File "/download/nova-2011.1/nova/utils.py", line 35, in <module>
(nova.root): TRACE: import netaddr
(nova.root): TRACE: ImportError: No module named netaddr
(nova.root): TRACE:

and if i added it like this :

import os
import subprocess
from setuptools import setup, find_packages
from setuptools.command.sdist import sdist
from nova.utils import parse_mailmap, str_dict_replace
from nova import version
from nova import log as logging
logging.basicConfig()
if os.path.isdir('.bzr'):

then it's also No handlers could be found for logger "nova.root"

Revision history for this message
Vish Ishaya (vishvananda) said :
#11

Well there you go, you need to install the netaddr module via pip install
netaddr or apt-get install python-netaddr.
On Feb 14, 2011 6:53 PM, "shihangwei" <email address hidden>
wrote:
> Question #145300 on OpenStack Compute (nova) changed:
> https://answers.launchpad.net/nova/+question/145300
>
> Status: Answered => Open
>
> shihangwei is still having a problem:
> hello,Vish
> i added it like this:
>
> import os
> import subprocess
> from nova import log as logging
> logging.basicConfig()
> from setuptools import setup, find_packages
> from setuptools.command.sdist import sdist
> from nova.utils import parse_mailmap, str_dict_replace
> from nova import version
> if os.path.isdir('.bzr'):
>
> and new error : ( ,as follows:
>
> 2011-02-15 08:44:41,544 CRITICAL nova.root [-] No module named netaddr
> (nova.root): TRACE: Traceback (most recent call last):
> (nova.root): TRACE: File "setup.py", line 29, in <module>
> (nova.root): TRACE: from nova.utils import parse_mailmap, str_dict_replace
> (nova.root): TRACE: File "/download/nova-2011.1/nova/utils.py", line 35,
in <module>
> (nova.root): TRACE: import netaddr
> (nova.root): TRACE: ImportError: No module named netaddr
> (nova.root): TRACE:
>
>
> and if i added it like this :
>
> import os
> import subprocess
> from setuptools import setup, find_packages
> from setuptools.command.sdist import sdist
> from nova.utils import parse_mailmap, str_dict_replace
> from nova import version
> from nova import log as logging
> logging.basicConfig()
> if os.path.isdir('.bzr'):
>
> then it's also No handlers could be found for logger "nova.root"
>
> --
> You received this question notification because you are a member of Nova
> Core, which is an answer contact for OpenStack Compute (nova).

Revision history for this message
shihangwei (shihangwei) said :
#12

yes,i think

from nova import log as logging
logging.basicConfig()

worked.