Merge lp:~gocept/landscape-client/py3-monitor-loadaverage-computerinfo into lp:~landscape/landscape-client/trunk

Proposed by Steffen Allner
Status: Merged
Approved by: Eric Snow
Approved revision: 993
Merged at revision: 991
Proposed branch: lp:~gocept/landscape-client/py3-monitor-loadaverage-computerinfo
Merge into: lp:~landscape/landscape-client/trunk
Prerequisite: lp:~gocept/landscape-client/py3-monitor-mountinfo
Diff against target: 95 lines (+16/-9)
3 files modified
landscape/monitor/tests/test_computerinfo.py (+2/-1)
landscape/monitor/tests/test_loadaverage.py (+12/-6)
py3_ready_tests (+2/-2)
To merge this branch: bzr merge lp:~gocept/landscape-client/py3-monitor-loadaverage-computerinfo
Reviewer Review Type Date Requested Status
Daniel Havlik (community) Approve
🤖 Landscape Builder test results Approve
Eric Snow (community) Approve
Review via email: mp+321303@code.launchpad.net

Commit message

This is the Py3 port of landscape.monitor.loadaverage and l.m.computerinfo.

The only change is to use the next() builtin instead of iterator.next().

Description of the change

In the tests for landscape.monitor.loadaverage and l.m.computerinfo generators have been used calling their .next() method, but we need to use the next() builtin in Python 3.

To post a comment you must log in.
Revision history for this message
🤖 Landscape Builder (landscape-builder) :
review: Abstain (executing tests)
Revision history for this message
🤖 Landscape Builder (landscape-builder) wrote :

Command: TRIAL_ARGS=-j4 make ci-check
Result: Success
Revno: 993
Branch: lp:~gocept/landscape-client/py3-monitor-loadaverage-computerinfo
Jenkins: https://ci.lscape.net/job/latch-test-xenial/3816/

review: Approve (test results)
Revision history for this message
Eric Snow (ericsnowcurrently) wrote :

LGTM

review: Approve
Revision history for this message
🤖 Landscape Builder (landscape-builder) :
review: Abstain (executing tests)
Revision history for this message
🤖 Landscape Builder (landscape-builder) wrote :

Command: TRIAL_ARGS=-j4 make ci-check
Result: Success
Revno: 993
Branch: lp:~gocept/landscape-client/py3-monitor-loadaverage-computerinfo
Jenkins: https://ci.lscape.net/job/latch-test-xenial/3823/

review: Approve (test results)
Revision history for this message
Daniel Havlik (nilo) wrote :

+1

review: Approve
Revision history for this message
🤖 Landscape Builder (landscape-builder) wrote :
Download full text (190.9 KiB)

The attempt to merge lp:~gocept/landscape-client/py3-monitor-loadaverage-computerinfo into lp:landscape-client failed. Below is the output from the failed tests.

sudo apt -y install python-twisted-core python-distutils-extra python-mock python-configobj python-passlib
Reading package lists...
Building dependency tree...
Reading state information...
python-configobj is already the newest version (5.0.6-2).
python-mock is already the newest version (1.3.0-2.1ubuntu1).
python-passlib is already the newest version (1.6.5-4).
python-twisted-core is already the newest version (16.0.0-1).
python-distutils-extra is already the newest version (2.39-1).
The following packages were automatically installed and are no longer required:
  golang-check.v1-dev golang-context-dev golang-github-gorilla-mux-dev
  golang-yaml.v2-dev linux-headers-4.4.0-57 linux-headers-4.4.0-57-generic
  linux-headers-4.4.0-59 linux-headers-4.4.0-59-generic linux-headers-4.4.0-62
  linux-headers-4.4.0-62-generic linux-headers-4.4.0-63
  linux-headers-4.4.0-63-generic linux-headers-4.4.0-64
  linux-headers-4.4.0-64-generic linux-headers-4.4.0-66
  linux-headers-4.4.0-66-generic linux-image-4.4.0-57-generic
  linux-image-4.4.0-59-generic linux-image-4.4.0-62-generic
  linux-image-4.4.0-63-generic linux-image-4.4.0-64-generic
  linux-image-4.4.0-66-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 26 not upgraded.
sudo apt -y install python3-twisted python3-distutils-extra python3-mock python3-configobj python3-passlib
Reading package lists...
Building dependency tree...
Reading state information...
python3-configobj is already the newest version (5.0.6-2).
python3-twisted is already the newest version (16.0.0-1).
python3-distutils-extra is already the newest version (2.39-1).
python3-mock is already the newest version (1.3.0-2.1ubuntu1).
python3-passlib is already the newest version (1.6.5-4).
The following packages were automatically installed and are no longer required:
  golang-check.v1-dev golang-context-dev golang-github-gorilla-mux-dev
  golang-yaml.v2-dev linux-headers-4.4.0-57 linux-headers-4.4.0-57-generic
  linux-headers-4.4.0-59 linux-headers-4.4.0-59-generic linux-headers-4.4.0-62
  linux-headers-4.4.0-62-generic linux-headers-4.4.0-63
  linux-headers-4.4.0-63-generic linux-headers-4.4.0-64
  linux-headers-4.4.0-64-generic linux-headers-4.4.0-66
  linux-headers-4.4.0-66-generic linux-image-4.4.0-57-generic
  linux-image-4.4.0-59-generic linux-image-4.4.0-62-generic
  linux-image-4.4.0-63-generic linux-image-4.4.0-64-generic
  linux-image-4.4.0-66-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 26 not upgraded.
python setup.py build_ext -i
running build_ext
python3 setup.py build_ext -i
running build_ext
LC_ALL=C trial --unclean-warnings -j4 landscape
Running 2178 tests.
landscape.broker.tests.test_amp
  RemoteBrokerTest
    test_call_if_accepted ... [OK]
    test_fire_event ... [OK]
    test_get_accepted_message_types ... [OK]
    test_get_server...

Revision history for this message
🤖 Landscape Builder (landscape-builder) wrote :

No approved revision specified.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'landscape/monitor/tests/test_computerinfo.py'
2--- landscape/monitor/tests/test_computerinfo.py 2017-03-13 15:15:46 +0000
3+++ landscape/monitor/tests/test_computerinfo.py 2017-03-29 14:17:46 +0000
4@@ -115,7 +115,8 @@
5 i = i + 1
6
7 self.mstore.set_accepted_types(["computer-info"])
8- plugin = ComputerInfo(get_fqdn=hostname_factory().next,
9+ hostname_fact = hostname_factory()
10+ plugin = ComputerInfo(get_fqdn=lambda: next(hostname_fact),
11 fetch_async=self.fetch_func)
12 self.monitor.add(plugin)
13
14
15=== modified file 'landscape/monitor/tests/test_loadaverage.py'
16--- landscape/monitor/tests/test_loadaverage.py 2016-06-15 18:02:26 +0000
17+++ landscape/monitor/tests/test_loadaverage.py 2017-03-29 14:17:46 +0000
18@@ -63,8 +63,9 @@
19 messages. Timestamps should always be contiguous, and always
20 fall on a step boundary.
21 """
22+ _load_averages = get_load_average()
23 plugin = LoadAverage(create_time=self.reactor.time,
24- get_load_average=get_load_average().next)
25+ get_load_average=lambda: next(_load_averages))
26 self.monitor.add(plugin)
27
28 for i in range(1, 10):
29@@ -80,8 +81,9 @@
30 available, a message with an empty C{load-averages} list is
31 expected.
32 """
33+ load_averages = get_load_average()
34 plugin = LoadAverage(create_time=self.reactor.time,
35- get_load_average=get_load_average().next)
36+ get_load_average=lambda: next(load_averages))
37 self.monitor.add(plugin)
38
39 self.reactor.advance(self.monitor.step_size)
40@@ -100,8 +102,9 @@
41 """
42 self.mstore.set_accepted_types(["load-average"])
43
44+ load_averages = get_load_average()
45 plugin = LoadAverage(create_time=self.reactor.time,
46- get_load_average=get_load_average().next)
47+ get_load_average=lambda: next(load_averages))
48 self.monitor.add(plugin)
49
50 self.monitor.exchange()
51@@ -116,8 +119,9 @@
52 """
53 self.mstore.set_accepted_types(["load-average"])
54
55+ load_averages = get_load_average()
56 plugin = LoadAverage(create_time=self.reactor.time,
57- get_load_average=get_load_average().next)
58+ get_load_average=lambda: next(load_averages))
59 self.monitor.add(plugin)
60
61 self.reactor.advance(self.monitor.step_size * 2)
62@@ -128,8 +132,9 @@
63 "load-averages": [(300, 10.5), (600, 30.5)]}])
64
65 def test_call_on_accepted(self):
66+ load_averages = get_load_average()
67 plugin = LoadAverage(create_time=self.reactor.time,
68- get_load_average=get_load_average().next)
69+ get_load_average=lambda: next(load_averages))
70 self.monitor.add(plugin)
71
72 self.reactor.advance(self.monitor.step_size * 1)
73@@ -145,8 +150,9 @@
74 Don't add any messages at all if the broker isn't currently
75 accepting their type.
76 """
77+ load_averages = get_load_average()
78 plugin = LoadAverage(create_time=self.reactor.time,
79- get_load_average=get_load_average().next)
80+ get_load_average=lambda: next(load_averages))
81 self.monitor.add(plugin)
82
83 self.reactor.advance(self.monitor.step_size * 2)
84
85=== modified file 'py3_ready_tests'
86--- py3_ready_tests 2017-03-29 14:17:46 +0000
87+++ py3_ready_tests 2017-03-29 14:17:46 +0000
88@@ -10,7 +10,7 @@
89 landscape.monitor.tests.test_activeprocessinfo
90 landscape.monitor.tests.test_computeruptime
91 landscape.monitor.tests.test_mountinfo
92-
93-
94+landscape.monitor.tests.test_computerinfo
95+landscape.monitor.tests.test_loadaverage
96
97

Subscribers

People subscribed via source and target branches

to all changes: