CP-8580: Add pylint configuration file.

Signed-off-by: Siddharth Vinothkumar <siddharth.vinothkumar@citrix.com>
Reviewed-by: Mate Lakat <mate.lakat@citrix.com>

GitHub: closes #137 on xapi-project/sm
CP-8580: Add MAX_TIMEOUT to LUNperVDI.py

Signed-off-by: Siddharth Vinothkumar <siddharth.vinothkumar@citrix.com>
Reviewed-by: Mate Lakat <mate.lakat@citrix.com>

GitHub: closes #137 on xapi-project/sm
CP-8580: Fix undefined variables in RawHBASR.py

- Variables sr_ref and host_ref are undefined in '_add_pbd_other_config'.
  Use self.sr_ref and self.host_ref instead.

Signed-off-by: Siddharth Vinothkumar <siddharth.vinothkumar@citrix.com>
Reviewed-by: Mate Lakat <mate.lakat@citrix.com>

GitHub: closes #137 on xapi-project/sm
CP-8580: Fix method issues with blktap2.py

- '_mklink' is not a class method. Hence use 'self' instead of 'cls'.

Signed-off-by: Siddharth Vinothkumar <siddharth.vinothkumar@citrix.com>
Reviewed-by: Mate Lakat <mate.lakat@citrix.com>

GitHub: closes #137 on xapi-project/sm
CP-8580: Fix method issues with lcache.py

- 'from_tapdisk' is a class method. Hence use 'cls' instead of 'self'.

Signed-off-by: Siddharth Vinothkumar <siddharth.vinothkumar@citrix.com>
Reviewed-by: Mate Lakat <mate.lakat@citrix.com>

GitHub: closes #137 on xapi-project/sm
CP-8580: Fix method issues with mpathcount.py

- The original code overwrites 'add'/'remove' methods with internal
ones. Rename them to '_add'/'_remove' to prevent accidental shadowing.

Signed-off-by: Siddharth Vinothkumar <siddharth.vinothkumar@citrix.com>
Reviewed-by: Mate Lakat <mate.lakat@citrix.com>

GitHub: closes #137 on xapi-project/sm
CP-8580: Fix incorrect log print by adding '%'.

Signed-off-by: Siddharth Vinothkumar <siddharth.vinothkumar@citrix.com>
Reviewed-by: Mate Lakat <mate.lakat@citrix.com>

GitHub: closes #137 on xapi-project/sm
CP-8580: Fix undefined variable in srmetadata.py

- Undefined variable 'diff' was referenced in the else cause.
Fix dangling reference by adding the variable.

Signed-off-by: Siddharth Vinothkumar <siddharth.vinothkumar@citrix.com>
Reviewed-by: Mate Lakat <mate.lakat@citrix.com>

GitHub: closes #137 on xapi-project/sm
CP-8580: Don't import unused 'stat' module.

- The 'stat' module was imported but unused. Also, we define a function
 with the same name which causes the module to be shadowed.

Signed-off-by: Siddharth Vinothkumar <siddharth.vinothkumar@citrix.com>
Reviewed-by: Mate Lakat <mate.lakat@citrix.com>

GitHub: closes #137 on xapi-project/sm
CP-8629: Direct PPA install

A build system behind a firewall cannot use apt-add-repository directly.
To workaround the problem, including the public key and adding the
repository directly as part of
install_prerequisites_for_python_unittests.sh script.

Signed-off-by: Mate Lakat <mate.lakat@citrix.com>
Acked-by: Chandrika Srinivasan <chandrika.srinivasan@citrix.com>

GitHub: closes #141 on xapi-project/sm
CP-8629: Install to temporary directory

While making snapwatchd, the binaries are also installed. If DESTDIR is
not set, it means that the binaries will be installed to the /
directory. Create a temporary directory, and set that as DESTDIR to
avoid polluting the root directory.

Signed-off-by: Mate Lakat <mate.lakat@citrix.com>
Acked-by: Chandrika Srinivasan <chandrika.srinivasan@citrix.com>

GitHub: closes #141 on xapi-project/sm
CP-8629: Install coverage

Install coverage package, so unit test coverage could be measured.

Signed-off-by: Mate Lakat <mate.lakat@citrix.com>
Acked-by: Chandrika Srinivasan <chandrika.srinivasan@citrix.com>

GitHub: closes #141 on xapi-project/sm
CP-8629: Run unittests with coverage

Run unittests with coverage and report both unit test results and
coverage in computer consumable format.

Signed-off-by: Mate Lakat <mate.lakat@citrix.com>
Acked-by: Chandrika Srinivasan <chandrika.srinivasan@citrix.com>

GitHub: closes #141 on xapi-project/sm