Merge lp:~nuclearbob/utah/bug1082171 into lp:utah

Proposed by Max Brustkern
Status: Rejected
Rejected by: Max Brustkern
Proposed branch: lp:~nuclearbob/utah/bug1082171
Merge into: lp:utah
Diff against target: 47 lines (+14/-4)
1 file modified
utah/provisioning/vm/vm.py (+14/-4)
To merge this branch: bzr merge lp:~nuclearbob/utah/bug1082171
Reviewer Review Type Date Requested Status
Max Brustkern (community) Disapprove
Javier Collado (community) Needs Fixing
Review via email: mp+142117@code.launchpad.net

Description of the change

I've been unable to recreate the issue in lp:1082171 outside of the lab so far. This is the code I've been using to test it. Since it's just some additional logging, I'd like to consider merging it into the dev branch so we can see the output on all the normal smoke test jobs that are running.

To post a comment you must log in.
Revision history for this message
Javier Collado (javier.collado) wrote :

Please find below some comments:

- Looks like the newly imported `time` module isn't being used anywhere.
- The `pass` statement in line 37 (438 in the source file) should be removed.

Isn't really part of this merge, but this line caught my eye:
while vm.isActive() is not 0:

- What is the set of valid output values of vm.isActive? Could "is not 0" be
  dropped?
- How long does it take vm.isActive to return a value? Could that cause that
  lots of log lines are printed to stderr?

Regarding the intended usage of this code. My understanding is that it will be
removed once the bug is fixed, so isn't something that we want to have in final
code. In such a case, while you're troubleshooting the problem, I think it
would be better to temporarily disable the jobs that update the packages in the
testing hardware and manually modify the installed .py files there. What do you
think about this?

review: Needs Fixing
Revision history for this message
Max Brustkern (nuclearbob) wrote :

We've got improved SSH logging, and we're working on improved installer logging elsewhere, so I think we should reject this proposal.

review: Disapprove

Unmerged revisions

794. By Max Brustkern

Writing log file size periodically to debug

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'utah/provisioning/vm/vm.py'
2--- utah/provisioning/vm/vm.py 2012-12-17 19:55:15 +0000
3+++ utah/provisioning/vm/vm.py 2013-01-07 14:06:26 +0000
4@@ -24,6 +24,7 @@
5 import shutil
6 import string
7 import tempfile
8+import time
9
10 from xml.etree import ElementTree
11
12@@ -401,8 +402,8 @@
13 serial = ElementTree.Element('serial')
14 serial.set('type', 'file')
15 source = ElementTree.Element('source')
16- log_filename = os.path.join(config.logpath, self.name + '.syslog.log')
17- source.set('path', log_filename)
18+ self.installlog = os.path.join(config.logpath, self.name + '.syslog.log')
19+ source.set('path', self.installlog)
20 serial.append(source)
21 target = ElementTree.Element('target')
22 target.set('port', '0')
23@@ -426,13 +427,22 @@
24 vm.create()
25 self.logger.info('Installing system on VM (may take over an hour)')
26 self.logger.info('You can watch the progress with virt-viewer')
27- log_filename = os.path.join(config.logpath, self.name + '.syslog.log')
28- self.logger.info('Logs will be written to ' + log_filename)
29+ self.logger.info('Logs will be written to ' + self.installlog)
30+ self.logger.debug('Log file size is {}'
31+ .format(os.path.getsize(self.installlog)))
32
33 while vm.isActive() is not 0:
34+ self.logger.debug('Log file size is {}'
35+ .format(os.path.getsize(self.installlog)))
36+
37 pass
38
39+ self.logger.debug('Log file size is {}'
40+ .format(os.path.getsize(self.installlog)))
41 vm.undefine()
42+ self.logger.debug('Log file size is {}'
43+ .format(os.path.getsize(self.installlog)))
44+
45 self.logger.info('Installation complete')
46
47 def _finalxml(self, tmpdir=None, xml=None):

Subscribers

People subscribed via source and target branches