arch_utils: arch lists on one place
ClosedPublic

Authored by lbrabec on Aug 22 2014, 10:49 AM.

Details

Summary

All arbitrary lists were moved to libtaskotron.arch_utils.
Arch strings and lists all over the code were replaced with atributes of class Arches (probably WIP).

Test Plan

py.test -F testing/

Diff Detail

Repository
rLTRN libtaskotron
Lint
Lint Skipped
Unit
Unit Tests Skipped
lbrabec retitled this revision from to arch_utils: arch lists on one place.Aug 22 2014, 10:49 AM
lbrabec updated this object.
lbrabec edited the test plan for this revision. (Show Details)
lbrabec added a reviewer: kparal.

A few things to consider below

libtaskotron/arch_utils.py
10

Maybe all the attributes can be class attributes? It will make the imports easier:

from libtaskotron.arch_utils import Arches

and then Arches don't clash with arches (which is a usual variable name) :-)

11–18

I'm not sure we gain too much by using attributes here instead of using plain strings inside our code. E.g.:

if Arches.i386 in arches:

instead of

if 'i386' in arches:

The second one seems simpler.

20

Let's include this once we need it.

22

It depends on the use case, but I think all would be better to include really everything, i.e. lines 10-17.

25

If we keep this, I'd rename it to x86_32 to make it clear.

libtaskotron/directives/bodhi_directive.py
129

If we change all to include really all, let's make sure it works well for Bodhi.

133–134

I think the old approach is a bit more readable, I'd stick with it.

libtaskotron/directives/yumrepoinfo_directive.py
90–91

This approach should be used in this case.

libtaskotron/rpm_utils.py
14–15

Let's move this to arch_utils?

lbrabec updated this revision to Diff 628.Aug 22 2014, 1:18 PM
  • polishing
lbrabec updated this revision to Diff 629.Aug 22 2014, 1:20 PM
  • polishing 2
lbrabec updated this revision to Diff 630.Aug 22 2014, 1:52 PM
  • polishing 3
lbrabec updated this revision to Diff 631.Aug 22 2014, 1:54 PM
  • polishing 3.5
kparal requested changes to this revision.Aug 22 2014, 2:04 PM
kparal added inline comments.
libtaskotron/arch_utils.py
9

Doc please.

libtaskotron/directives/koji_directive.py
7 ↗(On Diff #631)

Seems unneeded.

libtaskotron/directives/yumrepoinfo_directive.py
93–94

"single base arch"

libtaskotron/koji_utils.py
20 ↗(On Diff #631)

RM?

testing/test_rpm_utils.py
11

Please move to test_arch_utils.py.

This revision now requires changes to proceed.Aug 22 2014, 2:04 PM
lbrabec updated this revision to Diff 632.Aug 26 2014, 8:21 AM
  • polishing 4
jskladan accepted this revision.Aug 26 2014, 8:29 AM
jskladan added a reviewer: jskladan.
jskladan added a subscriber: jskladan.

Macro doge:                much nice                                          very push?

lbrabec closed this revision.Aug 26 2014, 11:24 AM
lbrabec updated this revision to Diff 633.

Closed by commit rLTRNd7b18ad18c86 (authored by @lbrabec).