launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #12802
Re: [Merge] lp:~gz/maas/populate_hardware_details into lp:maas
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 10/2/2012 9:36 PM, Martin Packman wrote:
> Martin Packman has proposed merging
> lp:~gz/maas/populate_hardware_details into lp:maas.
>
> Requested reviews: Launchpad code reviewers (launchpad-reviewers)
>
> For more details, see:
> https://code.launchpad.net/~gz/maas/populate_hardware_details/+merge/127551
>
>
>
Migrates existing lshw output from commissioned nodes into
> hardware_details on Node and fills in cpu_count and memory which
> depend on its value.
>
> As this is a little unusual, I've stuck some detailed notes in the
> migration module's docstring rather than just explaining here.
>
>
_xpath_processor_count =
"count(//node[@id='core']/node[@class='processor'])"
- -_xpath_memory_bytes = ("//node[@id='memory']/size[@units='bytes']/text()"
- - " div 1048576")
- -
- -
- -def update_hardware_details(node, xmlbytes):
+_xpath_memory_bytes = ("//node[@id='memory']/size[@units='bytes'] div
1048576")
If you are rewrapping this because you removed 'text()' you can get
rid of the parenthesis as well.
...
Because we aren't deleting the data from NodeCommissioningResult
(yet), the proper reverse migration is to just drop the column from
Node and you are done (no need to repopulate the other table, I think).
Otherwise, it is nice that this works, but isn't the real test if it
works during a 'apt-get upgrade' ? Do you expect that to work?
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (Cygwin)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/
iEYEARECAAYFAlBrPC8ACgkQJdeBCYSNAAOKAwCgsYnTvjPfgqq1zipdJ7mpeQrw
cSwAnRgA9s/frRlatgi9u4U1l6jzT5GG
=/5+4
-----END PGP SIGNATURE-----
--
https://code.launchpad.net/~gz/maas/populate_hardware_details/+merge/127551
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~gz/maas/populate_hardware_details into lp:maas.
Follow ups
References