bug fix: Expose repository management tool name

More than expose if there is a repository management tool recognized by
Kimchi, we also need to expose which tool is it.
The repository information depends on its type and UI needs to know it
to properly build the view.

Signed-off-by: Aline Manera <alinefm@br.ibm.com>
bug fix: Reorganize repository information

There are some specific repository data according to its type.
'deb' repositories have dist and componenets and that information does
not make sense for a 'yum' repository.
The same way a 'yum' repository has name, mirrorlist, gpgcheck,
gpgkey that only make sense for this type of repo.

Signed-off-by: Aline Manera <alinefm@br.ibm.com>
mockmodel: Move specific repository data under 'config'

There are some specific repository data according to its type.
'deb' repositories have dist and componenets and that information does
not make sense for a 'yum' repository.
The same way a 'yum' repository has name, id, mirrorlist, gpgcheck,
gpgkey that only make sense for this type of repo.

Also let the exception comming from the backend be raised. As it
contains more details about the problem. Otherwise, we will always show
generic error message "Unable to update repository"

Signed-off-by: Aline Manera <alinefm@br.ibm.com>
Update messages used in the repositories management feature

There is no need to have generic error messages.
We should provide the most detailed message we can.
Also update the .po files to reflect those changes

Signed-off-by: Aline Manera <alinefm@br.ibm.com>
bug fix: Raise exception comming from backend

The backend has a more detailed information when a problem occurs, so
raise this exception instead of get it and raise a generic error message
"Unable to update repository", "Unable to create repository" and so

Signed-off-by: Aline Manera <alinefm@br.ibm.com>
bug fix: Sort repositories

Return a sorted list while listing the repository to make sure about
their position on UI

Signed-off-by: Aline Manera <alinefm@br.ibm.com>
bug fix: Let package manager tool create the repository ID

The repository ID differs according to the repository type: deb or yum.
For yum repositories, the repository ID is kept in the repository
configuration file - so we can choose an arbitrary one as it will be
saved in a file.
But for a deb repository the ID does not exist. For internal proposals, we
build the ID for it based on url + dist + comps.

Signed-off-by: Aline Manera <alinefm@br.ibm.com>
bug fix: Do not store internal repository information

The former repository management implementation was storing the
repositories data internally. So it got the system data once and use it
on it. Which is wrong, as user can manage the system with other tools
and kimchi will show inconsistent data.

In addition to it, this patch also make many improvements:
  - Keep repository configuration file consistent on each actions
  - Use ConfigParser to add a new YUM repository
  - Let user specify a mirrorlist and a baseurl
    The mirrorlist can be used instead of or with the baseurl option.
    For reference: http://linux.die.net/man/5/yum.conf
  - Remove only the YUM repository section on config file instead of
    remove the while file
  - List all repositories (instead of only the enabled ones)

Signed-off-by: Aline Manera <alinefm@br.ibm.com>
Update test cases to reflect the repositories changes

Based on the lastest repositories changes we need to update the test cases.
And make sure to create the correct repository type according to the system.

Signed-off-by: Aline Manera <alinefm@br.ibm.com>
bug fix: Lock yum/apt operations

Just one yum/apt process can run per time so we need to lock those
operations to avoid race condition problems.

yum has a built in lock but it does not work well in kimchi as it only
prevents the user to run two different YUM applications. As the kimchi threads
are part of the same process, YUM does not really acquire the lock and
then we get the error:

[...]
  File "/usr/lib/python2.7/site-packages/urlgrabber/grabber.py", line 1258, in __init__
    self._do_open()
  File "/usr/lib/python2.7/site-packages/urlgrabber/grabber.py", line 1588, in _do_open
    self._set_opts()
  File "/usr/lib/python2.7/site-packages/urlgrabber/grabber.py", line 1375, in _set_opts
    self.curl_obj.setopt(pycurl.NOPROGRESS, False)
error: cannot invoke setopt() - perform() is currently running

So create a kimchi lock to solve this problem.
This lock can be used in any other place when needed.

Signed-off-by: Aline Manera <alinefm@br.ibm.com>