Hi all,
Does anyone have a desire to review a code review heavy on Python
properties and refactoring of a sprawling initialization across a program
to mostly moved into the appropriate class? It's not too bad really, just
a lot of repetitive changes from foo.get_bar() to foo.bar.
Webrev:
http://cr.opensolaris.org/~clayb/12686/
Testing:
I've run python by hand by renaming publish-manifest to
./publish_manifest.py and then:
>>>import publish_manifest as z
>>>import gettext
>>>gettext.install("ai", "/usr/lib/locale")
>>>b=z.DataFiles(service_dir = "/var/ai/46503", image_path =
"/var/ai/install_test_ai_x86", database_path = "/var/ai/46503/AI.db",
criteria_path = "/tmp/test.xml")
Warning: Using A/I manifest schema </usr/share/auto_install/ai_manifest.rng>
>>> b.criteria['arch']
'foobar'
>>> b.criteria['foobar']
(No KeyError/IndexError, NoneType returned here -- as it should be)
>>> b.criteria['mem']
['255', '256']
>>> b.criteria['mac']
['c0ffeec0ffee', 'c0ffeec0ffef']
As well, I used 'installadm add -m test.xml -n <service>' and the same for
a default.xml (setup as a default manifest). I used both range and value
criteria in my testing. To exercise things out, to ensure no silent
fail-throughs, I intentionally triggered range collisions and exact
manifest matches all were correctly triggered.
I used the A/I webserver to verify proper filesystem and database output.
I used 'installadm remove -m <manifest> -n <service>' to clean-up in
between tests.
Thank you,
Clay
PEP8 Compliance Statement for publish_manifest.py:
Raw Metrics
+----------+-------+------+---------+-----------+
|type |number |% |previous |difference |
+==========+=======+======+=========+===========+
|code |503 |55.40 |NC |NC |
+----------+-------+------+---------+-----------+
|docstring |149 |16.41 |NC |NC |
+----------+-------+------+---------+-----------+
|comment |152 |16.74 |NC |NC |
+----------+-------+------+---------+-----------+
|empty |104 |11.45 |NC |NC |
+----------+-------+------+---------+-----------+
Messages
(I disabled message E0602 as I use 'gettext.install("ai",
"/usr/lib/locale")' which provides _() however, pylint doesn't realize
that and so goes berserk. I ensured that only can't find function '_'
errors were caught by E0602.)
+-----------+-----------+
|message id |occurences |
+===========+===========+
|C0103 |26 |
+-----------+-----------+
|W0212 |9 |
+-----------+-----------+
|C0301 |5 |
+-----------+-----------+
Global evaluation
-----------------
Your code has been rated at 8.99/10