Merge lp://qastaging/~gmb/maas/loggerate-pserv into lp://qastaging/~maas-committers/maas/trunk

Proposed by Graham Binns
Status: Merged
Approved by: Graham Binns
Approved revision: no longer in the source branch.
Merged at revision: 2623
Proposed branch: lp://qastaging/~gmb/maas/loggerate-pserv
Merge into: lp://qastaging/~maas-committers/maas/trunk
Diff against target: 660 lines (+88/-78)
16 files modified
src/maasserver/dns.py (+1/-1)
src/maasserver/models/node.py (+1/-3)
src/provisioningserver/boot/tftppath.py (+5/-5)
src/provisioningserver/boot_images.py (+6/-6)
src/provisioningserver/dhcp/detect.py (+12/-12)
src/provisioningserver/dhcp/leases.py (+6/-6)
src/provisioningserver/dhcp/tests/test_detect.py (+16/-15)
src/provisioningserver/drivers/hardware/seamicro.py (+9/-3)
src/provisioningserver/image_download_service.py (+3/-3)
src/provisioningserver/import_images/helpers.py (+2/-3)
src/provisioningserver/logger/log.py (+2/-1)
src/provisioningserver/logger/tests/test_logger.py (+2/-1)
src/provisioningserver/start_cluster_controller.py (+5/-4)
src/provisioningserver/tags.py (+11/-11)
src/provisioningserver/tests/test_upgrade_cluster.py (+1/-0)
src/provisioningserver/upgrade_cluster.py (+6/-4)
To merge this branch: bzr merge lp://qastaging/~gmb/maas/loggerate-pserv
Reviewer Review Type Date Requested Status
Julian Edwards (community) Approve
Review via email: mp+228819@code.qastaging.launchpad.net

Commit message

Finish converting pserv to use maaslog.

Description of the change

Also added some logging to modules that imported the logger but didn't use it(!). Most of the changes are mechanical; I also reformatted and de-linted.

To post a comment you must log in.
Revision history for this message
Julian Edwards (julian-edwards) wrote :

Approved with comments!

review: Approve
Revision history for this message
Graham Binns (gmb) wrote :
Download full text (24.6 KiB)

On 30 July 2014 11:57, Julian Edwards <email address hidden> wrote:
> Review: Approve
>
> Approved with comments!
>
> Diff comments:
>
>> === modified file 'src/maasserver/dns.py'
>> --- src/maasserver/dns.py 2014-07-29 15:34:04 +0000
>> +++ src/maasserver/dns.py 2014-07-30 10:35:43 +0000
>> @@ -42,12 +42,12 @@
>> from maasserver.server_address import get_maas_facing_server_address
>> from netaddr import IPAddress
>> from provisioningserver import tasks
>> -from provisioningserver.logger import get_maas_logger
>> from provisioningserver.dns.config import (
>> DNSForwardZoneConfig,
>> DNSReverseZoneConfig,
>> SRVRecord,
>> )
>> +from provisioningserver.logger import get_maas_logger
>>
>>
>> maaslog = get_maas_logger("dns")
>>
>> === modified file 'src/maasserver/models/node.py'
>> --- src/maasserver/models/node.py 2014-07-29 16:17:51 +0000
>> +++ src/maasserver/models/node.py 2014-07-30 10:35:43 +0000
>> @@ -47,9 +47,7 @@
>> )
>> from django.shortcuts import get_object_or_404
>> import djorm_pgarray.fields
>> -from maasserver import (
>> - DefaultMeta,
>> - )
>> +from maasserver import DefaultMeta
>> from maasserver.enum import (
>> NODE_BOOT,
>> NODE_BOOT_CHOICES,
>>
>> === modified file 'src/provisioningserver/boot/tftppath.py'
>> --- src/provisioningserver/boot/tftppath.py 2014-07-24 16:08:39 +0000
>> +++ src/provisioningserver/boot/tftppath.py 2014-07-30 10:35:43 +0000
>> @@ -21,7 +21,6 @@
>>
>> import errno
>> from itertools import chain
>> -from logging import getLogger
>> import os.path
>>
>> from provisioningserver import config
>> @@ -33,9 +32,10 @@
>> BootImageMapping,
>> )
>> from provisioningserver.import_images.helpers import ImageSpec
>> -
>> -
>> -logger = getLogger(__name__)
>> +from provisioningserver.logger import get_maas_logger
>> +
>> +
>> +maaslog = get_maas_logger(__name__)
>
> I must admit I have mixed feelings about using __name__ here an avoided it so far. I think I might prefer "tftp" here as that is the general area in which this is logging.

Yarp. Fixed.

>
>>
>>
>> def compose_image_path(osystem, arch, subarch, release, label):
>> @@ -229,7 +229,7 @@
>> except OSError as exception:
>> if exception.errno == errno.ENOENT:
>> # Directory does not exist, so return empty list.
>> - logger.warning("No boot images have been imported yet.")
>> + maaslog.warning("No boot images have been imported yet.")
>> return []
>>
>> # Other error. Propagate.
>>
>> === modified file 'src/provisioningserver/boot_images.py'
>> --- src/provisioningserver/boot_images.py 2014-05-22 08:28:28 +0000
>> +++ src/provisioningserver/boot_images.py 2014-07-30 10:35:43 +0000
>> @@ -17,7 +17,6 @@
>> ]
>>
>> import json
>> -from logging import getLogger
>>
>> from apiclient.maas_client import (
>> MAASClient,
>> @@ -31,9 +30,10 @@
>> get_maas_url,
>> )
>> from provisioningserver.config import Config
>> -
>> -
>> -logger = getLogger(__name__)
>> +from provisioningserver.logger import get_maas_logger
>> +
>> +
>> +maaslog = get_maas_logger(__name__)
>
> Same h...

Revision history for this message
MAAS Lander (maas-lander) wrote :
Download full text (22.7 KiB)

The attempt to merge lp:~gmb/maas/loggerate-pserv into lp:maas failed. Below is the output from the failed tests.

Ign http://security.ubuntu.com trusty-security InRelease
Hit http://security.ubuntu.com trusty-security Release.gpg
Hit http://security.ubuntu.com trusty-security Release
Ign http://nova.clouds.archive.ubuntu.com trusty InRelease
Ign http://nova.clouds.archive.ubuntu.com trusty-updates InRelease
Hit http://nova.clouds.archive.ubuntu.com trusty Release.gpg
Get:1 http://nova.clouds.archive.ubuntu.com trusty-updates Release.gpg [933 B]
Hit http://nova.clouds.archive.ubuntu.com trusty Release
Get:2 http://nova.clouds.archive.ubuntu.com trusty-updates Release [58.5 kB]
Hit http://security.ubuntu.com trusty-security/main Sources
Hit http://security.ubuntu.com trusty-security/universe Sources
Hit http://security.ubuntu.com trusty-security/main amd64 Packages
Hit http://security.ubuntu.com trusty-security/universe amd64 Packages
Hit http://security.ubuntu.com trusty-security/main Translation-en
Hit http://security.ubuntu.com trusty-security/universe Translation-en
Hit http://nova.clouds.archive.ubuntu.com trusty/main Sources
Hit http://nova.clouds.archive.ubuntu.com trusty/universe Sources
Hit http://nova.clouds.archive.ubuntu.com trusty/main amd64 Packages
Ign http://security.ubuntu.com trusty-security/main Translation-en_US
Hit http://nova.clouds.archive.ubuntu.com trusty/universe amd64 Packages
Ign http://security.ubuntu.com trusty-security/universe Translation-en_US
Hit http://nova.clouds.archive.ubuntu.com trusty/main Translation-en
Hit http://nova.clouds.archive.ubuntu.com trusty/universe Translation-en
Get:3 http://nova.clouds.archive.ubuntu.com trusty-updates/main Sources [102 kB]
Get:4 http://nova.clouds.archive.ubuntu.com trusty-updates/universe Sources [62.6 kB]
Get:5 http://nova.clouds.archive.ubuntu.com trusty-updates/main amd64 Packages [275 kB]
Get:6 http://nova.clouds.archive.ubuntu.com trusty-updates/universe amd64 Packages [163 kB]
Hit http://nova.clouds.archive.ubuntu.com trusty-updates/main Translation-en
Hit http://nova.clouds.archive.ubuntu.com trusty-updates/universe Translation-en
Ign http://nova.clouds.archive.ubuntu.com trusty/main Translation-en_US
Ign http://nova.clouds.archive.ubuntu.com trusty/universe Translation-en_US
Ign http://nova.clouds.archive.ubuntu.com trusty-updates/main Translation-en_US
Ign http://nova.clouds.archive.ubuntu.com trusty-updates/universe Translation-en_US
Fetched 662 kB in 0s (1,674 kB/s)
Reading package lists...
sudo DEBIAN_FRONTEND=noninteractive apt-get -y \
     --no-install-recommends install apache2 bind9 bind9utils build-essential bzr-builddeb curl daemontools debhelper dh-apport distro-info dnsutils firefox freeipmi-tools ipython isc-dhcp-common libjs-raphael libjs-yui3-full libjs-yui3-min libpq-dev make postgresql python-amqplib python-bzrlib python-celery python-convoy python-crochet python-cssselect python-curtin python-dev python-distro-info python-django python-django-piston python-django-south python-djorm-ext-pgarray python-docutils python-formencode python-hivex python-httplib2 python-jinja2 python-jsonschema python-lockfile python-lxml python-netaddr python-netiface...

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.