Add testing of adding gittree without domain and deleting all gittree roles

To support gittree without domain, also update iris/etc/scm.py

Change-Id: Ie689ee50cf60c38e94980d8b03c96f6af95a62c6
Add download_snapshots.py script to setuptools

Change-Id: Iff010ad65a0856f79177148616a27fabb0ffd06a
Signed-off-by: gaoxuesx <xuesongx.gao@intel.com>
Fix build failure and dependency bug.

There isn't python-pyquery in pypi only pyquery.

download_snapshots.py should be listed in spec file.

Change-Id: I6973e44ba038cda52f9f55d75022d30e8939a1ff
Fix import version bug.

Since we are using "iris" as namespace package, its
__init__.py should not contain any other code than
declare_namespace(). So getting version string from
pkg_resources lib.

Document from setuptools:

  http://pythonhosted.org//setuptools/setuptools.html#namespace-packages

  You must NOT include any other code and data in a namespace
  package’s __init__.py. Even though it may appear to work during
  development, or when projects are installed as .egg files, it
  will not work when the projects are installed using "system"
  packaging tools – in such cases the __init__.py files will not
  be installed, let alone executed.

Change-Id: I7bf96d2876edeac725c0049a226694d69075ab26
Refactor data import code.

Add a class iris.elt.loader.Loader which provides two methods:
* sync_entity: create/update/delete entities
* sync_nnr: add/remove many to many relationship

Import script only need to rely on these two simple APIs in
order to hide complex syncing logic but only focus on business
logic.

Also add a helper class UserCache. It caches all user strings
in scm text files and merge user's first name, last name and
email. It also builds a index to retreive the user by string
written in scm text files.

Change-Id: I9cfdf12bd137b497d6c0c5eb38b8b8f124937eb2
Depends pyquery from 1.2.4 to 1.2.8

IRIS repo provides the latest version of this package.

Fixes: #2021
Change-Id: Ie7c39045871f7e8c0e67f514bc7dcf70b1be1dbd
Update README

Add a section for new commers about how to contribute to this
project.

Also Remove emails in this file, since it's public and I will
push code to github, so we'd better to remove this internal
emails at first.

Change-Id: Iafe7eb0108738d335444d0c763ed165430a542ad
Update AUTHORS file.

Add all developer's names into AUTHORS file.

Change-Id: I8525e799749d0a85a1bf11eadb3a23131c5c7003
Update the update_iris_data.sh script

Use update_iris_data.sh to run download_snapshots.py.
Add set proxy feature, so that the script could download snapshots when we
need proxy.

Change-Id: Ib7303f591471c8df1a1f2af8c29397a73a199965
Signed-off-by: gaoxuesx <xuesongx.gao@intel.com>
Change directory which downloading snapshot to

Change the downloading directory, which named by build date.

Change-Id: I4f04d7090a79f23dd7db0842bf540184ed137b37
Signed-off-by: gaoxuesx <xuesongx.gao@intel.com>
Fix bugs of UserCache.

There is bug in user _eq function. Have to check fields existence
before comparing them.

Ignore users without email, otherwise it's hard to make a unique
value for username field.

Add several tests for above cases.

Change-Id: I7cc07192e57f723607c4f66c45785d9e4a6fa1f9
Change scm blocks parsing rules.

Now scm blocks are separated by empty lines. By following this
definition, we can put domain string and git tree string together,
which makes parse_blocks() only need one argument. And makes
testing functions more readable.

Change-Id: I91d595556069295a395082d78be2cba303d98c9f
Install latest python-requests: 2.3.0

Change-Id: I0175a2d21bdcdbf0a46985514dfeb0aa7993901f
Fix gittree attribute error when get packages

Change-Id: Ia44127fbbce5a3f676e6468dbab2165456602f03
Fixes: #2032
Use requests instead of urllib2

Requests allow you to send HTTP/1.1 requests. You can add headers, form data,
multipart files, and parameters with simple Python dictionaries, and access the
response data in the same way. It's powered by httplib and urllib3, it is much
more simpler and cleaner.
Urllib2 requires an enormous amount of work to perform the simplest of tasks.

Change-Id: Ibdacaebb9c450a8343a6ad5f48c2b210469bce5c
Signed-off-by: gaoxuesx <xuesongx.gao@intel.com>
Image data migration

The Image name in IRIS DB has space, so strip space in the Image name.
Fixes: #2029

Change-Id: I425e10aaad963159f1cbdfeee54beb3d2c98db05
Signed-off-by: gaoxuesx <xuesongx.gao@intel.com>
Set fields name, target, product unique_together

The fields name, target, product should be unique, and unique field type
must be CharField.

Change-Id: I422ecc001942a10b0c6eb7ade2c608ac83981e4f
Signed-off-by: gaoxuesx <xuesongx.gao@intel.com>
Fixes the remove feature of entity and relation

The script removes other Images which don't belong to one Product.
It also removes the relationship between products and trees, and between
trees and packages of one Product, the relationship maybe exist in
the other Product.

Change-Id: I271de9db80910a4cc56c5295e6ed3a70788d061a
Signed-off-by: gaoxuesx <xuesongx.gao@intel.com>