Merge lp://staging/~qzhang/lava-dispatcher/remove-hardcode into lp://staging/lava-dispatcher
Proposed by
Spring Zhang
Status: | Superseded |
---|---|
Proposed branch: | lp://staging/~qzhang/lava-dispatcher/remove-hardcode |
Merge into: | lp://staging/lava-dispatcher |
Diff against target: |
212 lines (+116/-34) 6 files modified
.testr.conf (+3/-0) lava/actions/deploy.py (+1/-0) lava/client.py (+5/-34) lava/config.py (+76/-0) lava/tests/__init__.py (+6/-0) lava/tests/test_config.py (+25/-0) |
To merge this branch: | bzr merge lp://staging/~qzhang/lava-dispatcher/remove-hardcode |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Paul Larson | Pending | ||
Loïc Minier | Pending | ||
Review via email: mp+52216@code.staging.launchpad.net |
This proposal supersedes a proposal from 2011-03-03.
This proposal has been superseded by a proposal from 2011-03-07.
Description of the change
Update: merge Loic unit test code, thanks Loic.
Move all configurations to module to lava.config due to comments, now it's one module to import.
To post a comment you must log in.
Unmerged revisions
- 22. By Spring Zhang
-
move master_str and tester_str to config.py
- 21. By Spring Zhang
-
merge from mainline
- 20. By Spring Zhang
-
Remove unused function change_uboot_cmds()
On Wed, Mar 02, 2011, Spring Zhang wrote:
> Move hard code like board_type, lava_server_ip to a module lava.config
> 1. add two default config json files in cfg/, and it can be specified by other json files, which can extend board_type and board uboot cmd.
> 2. fix some issues, see r12
> 3. pass unit test
>
> Initially I plan to use json, Paul suggests to use module, consider the solution,
> 1. for there are some user-defined parameters like master server IP, unless LAVA is used only in Linaro validation team, we need to allow user to define such things.
> 2. for some fields which need to extend, like UBOOT configuration for different type of board. Or for item2, we can move to database?
I think you're very right to want to go to .cfg files, yet because the
config layout and parameters are still in lp:lava (which is a fairly
new project), I would think it's a tad too early to go into a config
file. Having the data in .py files is going to make our lives easier
in this early stage, and it will also make it easier to test.
> - cmd.get( 'parameters' , {}) 'parameters' , {})
> + params = cmd.get(
Hmm, right, this still ain't fixed in tip; I've just committed the fix
in r12 of lp:lava now; thanks
Your changes looked good; thanks! For now, I would just put everything
in .py instead of .cfg/.json; I don't have a strong view on this
though, so I prefer not approving or disapproving this mp.
> +if __name__ == "__main__": CFG().load( ) CFG.IP, LAVA_SERVER_ CFG.HOSTNAME) BOARD_TYPE. items() : BOARDS_ UBOOT.items( ):
> + """
> + unit test by executing:
> + python -m lava.config
> + in lp:lava root directory
> + """
> + #load lava server cfg
> + LAVA_SERVER_
> + print "Board type map"
> + print "%s %s" % (LAVA_SERVER_
> +
> + BOARD_CFG().load()
> + print "\nUboot cmd map"
> + for name, type in BOARD_CFG.
> + print "%s: %s" %(name, type)
> +
> + for type, cmd in BOARD_CFG.
> + print "%s: %s" %(type, cmd)
Ah it seems we need proper unit tests
--
Loïc Minier