Change in vdsm[master]: cleanup: Improve lib/vdsm imports (PEP328)

danken at redhat.com danken at redhat.com
Wed Nov 6 20:55:59 UTC 2013


Dan Kenigsberg has submitted this change and it was merged.

Change subject: cleanup: Improve lib/vdsm imports (PEP328)
......................................................................


cleanup: Improve lib/vdsm imports (PEP328)

PEP328 ( http://www.python.org/dev/peps/pep-0328/ ) does away with
the ambiguity of where the modules that are being imported reside
making the codebase much more browsable.

With a codebase of:
    package/
        __init__.py
        subpackage1/
            __init__.py
            moduleX.py
            moduleY.py
        subpackage2/
            __init__.py
            moduleZ.py
        moduleA.py

this (moduleY.py):
    import moduleX
    import moduleZ
becomes
    from . import moduleX
    from ..subpackage2 import moduleZ

Which makes it much more evident where things are and avoids possible
shadowing of packages in site-packages.

Change-Id: I249cfa0ad734ea45ecbbecbade9daeed6c3adc12
Signed-off-by: Antoni S. Puimedon <asegurap at redhat.com>
Reviewed-on: http://gerrit.ovirt.org/20555
Reviewed-by: Yaniv Bronhaim <ybronhei at redhat.com>
Reviewed-by: Dan Kenigsberg <danken at redhat.com>
---
M lib/vdsm/SecureXMLRPCServer.py
M lib/vdsm/ipwrapper.py
M lib/vdsm/libvirtconnection.py
M lib/vdsm/netconfpersistence.py
M lib/vdsm/netinfo.py
M lib/vdsm/qemuImg.py
M lib/vdsm/tool/dummybr.py
M lib/vdsm/tool/libvirt_configure.py
M lib/vdsm/tool/load_needed_modules.py.in
M lib/vdsm/tool/nwfilter.py
M lib/vdsm/tool/passwd.py
M lib/vdsm/tool/restore_nets.py
M lib/vdsm/tool/sanlock.py
M lib/vdsm/tool/seboolsetup.py
M lib/vdsm/tool/service.py
M lib/vdsm/tool/transient.py
M lib/vdsm/tool/validate_ovirt_certs.py.in
M lib/vdsm/tool/vdsm-id.py
M lib/vdsm/utils.py
M lib/vdsm/vdscli.py.in
20 files changed, 57 insertions(+), 57 deletions(-)

Approvals:
  Yaniv Bronhaim: Looks good to me, but someone else must approve
  Antoni Segura Puimedon: Verified
  Dan Kenigsberg: Looks good to me, approved



-- 
To view, visit http://gerrit.ovirt.org/20555
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I249cfa0ad734ea45ecbbecbade9daeed6c3adc12
Gerrit-PatchSet: 6
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegurap at redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap at redhat.com>
Gerrit-Reviewer: Assaf Muller <amuller at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski at gmail.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi at redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: mooli tayer <mtayer at redhat.com>


More information about the vdsm-patches mailing list