Give detail message when colon is missing.

Each line of scm data should contain key and value separated by
colon. If colon is missing, give a better message about this case.

Fixes: #2083
Change-Id: Ic1051c7a7aca892052592323186ef5efcfa7fd0b
Revert deleting migrations/0001_initial.py

When we install the latest version of iris-core rather than
upgrading from old version, it will complain that some database
table doesn't exist.

Because when we upgrade, the old tables are already there, all
migrations after 0001 can be run successfully. If we install
from scrach, iris.core app is managered by south, syncdb command
won't create any tables but use this 0001 migration to create
initial tables. If this file isn't there, all migration after
0001 will fail.

So we have to add it back, and keep it in source control in all
future versions.

Change-Id: Ia8719e46f4228a59350e1e72e3f111da54eac3f4
Add test fixtures.

Move some testing data into fixture files.

- users.json contains three users: "admin", "alice" and "robot".
  "robot" has the publish_events permission.
- domains.json contains a domain named "System".
- subdomains.json contains a subdomain "System / Logging".
- gittrees.json contains gittree "framework/system/dlog".
- products.json contains a product "Tizen:IVI".

Also add several get_by_natural_key() functions to refer models
by natrual key rather than id. Since id isn't always predictable
in fixture files.

Change-Id: Ia5d1716a0e38f2b260e8bd09f0c326c0a193f6e8
Refactor test_events_handlers.py

Move testing data into fixture file.

Change-Id: I70f104cbadb4a407b70babccfbd3c5fd591cc1a9
Catch exception of parse_blocks function

Change-Id: I6e7864d283f27e3d68517f5724e6d548f08d84f8
Signed-off-by: gaoxuesx <xuesongx.gao@intel.com>
Change field type of PackageBuild.package

Package names in OBS events BUILD_SUCCESS and BUILD_FAILURE are
binary(rpm) package name not OBS package name(git). So we can
change field PackageBuild.package from String to ForeignKey.

However since we can't get the mapping information in binary
package and git project. Then we can only know that a rpm
package built but we don't know this package is built from each
git tree. So for now we have to remove pbuilds field from
SubmissionBuild table and add a foreignkey(BuildGroup) into
PackageBuild table. This new field indicate all packages built
from a given BuildGroup.

Change-Id: I6a9e8dfaaf618932d50ed66a914561b1c2738963
Email parse error

Use re to match user name and email.
Add new test case to test user name with bracket.

Fixes: #2105

Change-Id: Ic7bedfde2caac2a339cc5f1e59a2523b4eaaccd9
Signed-off-by: gaoxuesx <xuesongx.gao@intel.com>
Remove the mail_admin feature of scm

We don't need to mail admin when updating and checking scm/meta/git.
So remove this feature.

Fixes: #2103

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