Github #368: Removing 'resend' tag from getHostStats JSON

As described in #368, the Hosts tab wasn't appearing after
relogging (due to restarting kimchid or even when the session
expires). The issue was in the getHostStats JSON, which was
marked with the 'resend' flag, preventing the Host tab from
reloading.

This behavior is set in the kimchi.login_window.js. This flag
isn't used for any other purpose, thus its removal does not
break the refresh of the System Statistics frame in the Hosts
tab. A description of the right usage of the 'resend' tag can
be found in the header of kimchi.api.js.

Signed-off-by: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com>
Fix Text Wrapping in Tab Bar

Tabs in tab bar was set to fixed width that will cut long text in
some languages. Fix it in this patch.

Signed-off-by: Hongliang Wang <hlwang@linux.vnet.ibm.com>
Fix Text Wrapping Problem in Template Edit

Long text will wrap in template edit window. Fix it.

Signed-off-by: Hongliang Wang <hlwang@linux.vnet.ibm.com>
Revert "Host Tab: Add Widths for Repository Grid Columns"

This reverts commit a67fe5426e1e86cbe589a2d48c0d404f50486ec2.

With this patch the repositories grid in Ubuntu system (deb repositories) only
display one column ("Enabled").
And without it, there is any difference in UI for yum or deb repositories.
Issue #369: Fix config_dir assignment

In proxy.py, the config_dir was only initialized in a 'if' statement and
used outside it.
So if the SSL certificate and key were received as parameters, config_dir
was undefined.
Fix it.

Signed-off-by: Aline Manera <alinefm@br.ibm.com>
Correct the ID String of Disk Size in Template Edit Window

It was "version" instead of "disk".

v2 -> v3:
  3a) Corrected id string from CDROM
      (Aline's comment)

v1 -> v2:
  2a) Added for attribute for version text box
      (Sheldon's comment)

Signed-off-by: Hongliang Wang <hlwang@linux.vnet.ibm.com>
host/partitions: avoid calling disks.get_partitions_names() for each partition

Problem:
In PartitionModel.lookup(), it calls disks.get_partitions_names() to
verify the given partition is eligible to be used in a new logical
storage pool as follow.
  if name not in disks.get_partitions_names():
      raise NotFoundError(...)

When the front-end issues GET request to host/partitions, the back-end
would call get_partitions_names() for each partition. If there are many
disks and partitions in the host, get_partitions_names() takes a long
time to finish, and calling get_partitions_names() for each partition
would make the GET request timeout.

In all, the original control flow is as follow.
  GET host/partitions
    Partitions._get_resources()
      PartitionsModel.get_list()
        disks.get_partitions_names()
        for each partition name:
          Partition.lookup()
            PartitionModel.lookup()
              verify partition name in disks.get_partitions_names()
              disks.get_partition_details()

The solution is to split the block device verification code out of
disks.get_partitions_names(), and put it in a new function
disks._is_available(). Now get_partitions_names() just returns
all the block devices, and disks.get_partition_details() can perform
the eligibility check by calling disks._is_available(). The original
get_partitions_names() checks eligibility for all the detected device,
so calling it for each partition is too slow. The new _is_available()
function just checks the given block device.

The New control flow is as follow.
  GET host/partitions
    Partitions._get_resources()
      PartitionsModel.get_list()
        disks.get_partitions_names()
        for each partition name:
          Partition.lookup()
            PartitionModel.lookup()
              disks.get_partition_details()
                check if the block device _is_available()

Signed-off-by: Zhou Zheng Sheng <zhshzhou@linux.vnet.ibm.com>
bug fix: Update test cases to use HTTPS

As all HTTP requests are redirected to HTTPS, the tests must be done
using HTTPS, otherwise all the responses from HTTP requests will be:

<html>
<head><title>302 Found</title></head>
<body bgcolor="white">
<center><h1>302 Found</h1></center>
<hr><center>nginx/1.2.1</center>
</body>
</html>

instead of the real data.
Fix it.

Signed-off-by: Aline Manera <alinefm@br.ibm.com>
bug fix: Allow changing default ports

After adding nginx as a reverse proxy, 3 ports needs to be specified to
start Kimchi.
- port to list on (default 8000)
- ssl_port to enable SSL connections (default 8001)
- cherrypy_port, the cherrypy server port (default 8010)

The kimchi.conf was inconsistent to that current Kimchi logic.
So the user was not able to change the default ports without having
problems to start Kimchi.

Fix it by adding cherrypy_port to kimchi.conf file and adjusting the
kimchid script to get the correct variable values.

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