saltstack/salt — pull request #14158 by rominf (2014-07-12 15:38:01+00:00)
Title: Add repo managing functionality to the zypper module

I've added functions `get_repo, list_repo, del_repo and mod_repo` into `modules.zypper`.

I've found 3 ways to manage repositories:
1. Manually handling .repo files (like in `yumpkg`)
2. Using `zypper`.
3. Using `libzypp` python binding.

First method requires writing lot's of code and I'm not sure that my "yet another rpm package manager" would be as stable as zypper is.

Second method requires to convert arguments into the format the zypper wants to read and parse zypper output. Moreover, zypper is simple command oriented, not dictionary oriented (for example, it uses `--enable` and `--disable` flags, but not `--enabled=True` and `--enabled=False`).

libzypp, in contrast is very convenient to wrap. So I've decided to use the latter method.

Dictionary keys are the same as in the `zypper lr repo` output, but keys are more Pythonic (`True`/`False` but not `1`/`0`).