Uniform import statements to absolute import.

Change all relative imports into absolute since mixing them is bad.
Refer PEP8 for more details.

Change-Id: I39fdbe056cb0d76c5ed5812c4f69e74ce8837924
Refactor get_mic_binpath() to avoid catch all exceptions.

Catch the specific exceptions it cares about, and reduce "try"
block to minimal, otherwise some other errors will be hidden.

Change-Id: Icbef03eef1591ba44466d5634943db5b8c86bdc4
Reraise exception in bootstrap_mic() but keep original traceback.

When exception occurs, we could add additional information but
should keep the original traceback. Otherwise traceback shows up
in console will be the second one, which hide the true exception.

A bare "raise" statement is a special syntax to reraise the
original exception, which will also keep its traceback.

Please Refer PEP3134 for more details.

Change-Id: I420399061de89b911cecd5da60fde0023f1893ac
Refactor function safecopy().

* Change ignore_ptns from [] to (). A mutable default value isn't
as expected when invoke in the second time.
>>> def safecopy(ignore_ptns=[]):
...     ignore_ptns += ['*.pyc']
...     print ignore_ptns
...
>>> safecopy()
['*.pyc']
>>> safecopy()
['*.pyc', '*.pyc']

* Add a list into ignore_ptns rather than a string
>>> l = []
>>> l += os.path.basename('/usr/bin')
>>> l
['b', 'i', 'n']

* Include all exception classes by (), otherwise it will catch
OSError and assign this exception instance to a local variable
named IOError.
* Move shutil.ignore_patterns() out of try block since it can
never throw OSError nor IOError.
* Remove useless try/except/raise block which catches every
error but reraise it. It's the same as without this try block.

Change-Id: I8837169bbf4acbadf4a2cfd8ac999d371831d86a
Fix an issue with building the man page

If the python-docutils package is available in a distro, then make sure
a BuildRequires is added for it.

Change-Id: Ic404fe4ed94bd40aa63139bec3c12b1bcdd59640
Change default parameters from mutable type into immutable.

Get ride of these pylint warnings:

W0102:190,0:cleanup_chrootenv: Dangerous default value [] as argument
W0102: 47,4:ImagerPlugin.check_image_exists: Dangerous default value [] as argument
W0102:109,8:read_kickstart.KSHandlers.__init__: Dangerous default value {} as argument
W0102:708,0:get_repos: Dangerous default value {} as argument
W0102:772,0:get_attachment: Dangerous default value [] as argument
W0102:775,0:get_pre_packages: Dangerous default value [] as argument
W0102:778,0:get_packages: Dangerous default value [] as argument
W0102:781,0:get_groups: Dangerous default value [] as argument
W0102:784,0:get_excluded: Dangerous default value [] as argument
W0102:787,0:get_partitions: Dangerous default value [] as argument
W0102:877,4:BaseImageCreator.install: Dangerous default value {} as argument
W0102:210,4:Bootstrap.create: Dangerous default value [] as argument

Change-Id: Icc04896829ecfb0e2542f4d4755f4adb07b01319
Change default mutable arguments of Mic_RepoData.__init__.

Only pass arguments includepkgs, excludepkgs, baseurl,
mirrorlist, name to super __init__ if they are not false.
If they are not present the super __init__ will choose proper
default values for those arguments.

W0102: 26,4:Mic_RepoData.__init__: Dangerous default value [] as argument
W0102: 26,4:Mic_RepoData.__init__: Dangerous default value [] as argument

Change-Id: I56db875ee3d42213726a147a46f9d2e998025cce
Remove useless try and reraise blocks.

These code catch all exceptions and simply reraise them, which is
equivalent to not writing the try block. So just remove them to
cleanup.

Change-Id: I965356746a5b349458205de9c5a1d6bf97bf8d93
Print warning when failed to temp ks in normalize_ksfile().

* print waring message in try/except block
* add doc string
* remove dir argument to tempfile.mkstemp, since its default
strategy is better than hardcode "/tmp"
* rename _clrtempks to remove_temp_ks and move it behind
* remove the code that check file existence, since it will be
always checked by confmgr.__set_ksconf

Change-Id: Ic4c6125f18eb9e9dda8faa7bc687f97b178b1cea
fix debuginfo rpm swig attr lost

when adding debuginfo rpm, the PoolItem doesn't
convert to Solvable

Change-Id: I221760667217421235849536def6bbcfd94199c2
Signed-off-by: Gui Chen <gui.chen@intel.com>
update AUTHORS

Change-Id: Iadf5be8daf386c777e7b73b2ff317cacd44ab0b8
Signed-off-by: Gui Chen <gui.chen@intel.com>
change naming for release option

move snapshot id forward

Change-Id: I537c938c562dd4933e422698bdc84b94cacb8fb5
Signed-off-by: Gui Chen <gui.chen@intel.com>
generate bmap file outside __imgdir

Change-Id: I8d2759a861619f3767f95c6be73fba0c8e457638
Signed-off-by: Gui Chen <gui.chen@intel.com>
strip slash after release option

Change-Id: I8746aaafb9d130a514ee623e62432bc0a3a6d343
Signed-off-by: Gui Chen <gui.chen@intel.com>
mount tmpdir as tmpfs to accelerate performance

use --tmpfs to enable this experimental feature

Change-Id: I5fb8e60a24236f7e6cab624a137c3ddb3d03f7d9
Signed-off-by: Gui Chen <gui.chen@intel.com>
bump up to version 0.18-rc0

Change-Id: Id94de376e152927ac4df1d0b2587129df5df64dd
Signed-off-by: Gui Chen <gui.chen@intel.com>
condider repo priority while sorting packages

standard criterion:
 - arch compatibility with highest priority
 - repo priority
 - package version have lowest priority

Change-Id: I86dcb35a568ddc0162e6145b6871dc2502c3d24f
fix conflict variable in cmpEVR and priority condition

Change-Id: Icd9b2eeac10e5f8265445d96cc9ceb1a5116d158
Signed-off-by: Gui Chen <gui.chen@intel.com>
fix attachment packages swig attr lost

Change-Id: Idaeabdd0c340f6f9f8f5eddae6eb17478115d11c
Signed-off-by: Gui Chen <gui.chen@intel.com>
bump up to release 0.18

Change-Id: Ia71f0f26a6cbf7e413939780e3a4131307a295a6
Signed-off-by: Gui Chen <gui.chen@intel.com>