Fix indent of the js files

v1-v2 keep the comment the orginal way.

1 Replace tabs with 4 spaces
2 Add space after "if"
3 Add space before and after ":""="
Signed-off-by: zhoumeina <zhoumein@linux.vnet.ibm.com>

Reviewed-by: Xin Ding<xinding@linux.vnet.ibm.com>
IE8: No selected style for items in the main

V1 -> V2 V1 commited a unrelated file, V2 delete it

In IE8, the style for indicating which menu item is selected is not displayed.

Signed-off-by: Xin Ding <xinding@linux.vnet.ibm.com>
IE8: No background style for items in the template list page

The background of items in the template list page can't be displayed in IE8.

Signed-off-by: Xin Ding <xinding@linux.vnet.ibm.com>
add a cachebust module to generate href with cacheBust

employ a file lastModified strategy for static content cache.
cachebust will generate the href with a cacheBust.
And the value of the cacheBust is the last modified time of the
static content file.

cachebust.href
input: the static content url,  such as: css/dev.base.css
output: url with cacheBust
        such as: css/dev.base.css?cacheBust=1376668916.87

Signed-off-by: ShaoHe Feng <shaohef@linux.vnet.ibm.com>
Signed-off-by: Adam King <rak@linux.vnet.ibm.com>
cacheBust parameter for static content caching

All references to the static content are supplemented with a cacheBust
parameter to cause cache misses whenever the content has changed

Signed-off-by: ShaoHe Feng <shaohef@linux.vnet.ibm.com>
Signed-off-by: Adam King <rak@linux.vnet.ibm.com>
set expires for static content caching

As Adam King suggested:
We don't think cache expires is a value that we will want a typical
admin changing as they would the other values in kimchi.conf.
so put the explicit value to just one place in the python code,
and comment that its a year, and have the other code reference it.
If we ever want to change it, we just need to update that one value.

after set the expires, the cilent can receive a response-head as follow.
response-head:
	HTTP/1.1 200 OK
	Content-Length: 55946
	Accept-Ranges: bytes
	Expires: Sun, 17 Aug 2014 08:27:06 GMT
	Server: CherryPy/3.2.2
	Last-Modified: Sat, 17 Aug 2013 08:26:23 GMT

Signed-off-by: ShaoHe Feng <shaohef@linux.vnet.ibm.com>
Signed-off-by: Xin Ding <xinding@linux.vnet.ibm.com>
Signed-off-by: zhoumeina <zhoumein@linux.vnet.ibm.com>
A module to check the pam authenticate

This authenticate base on PyPAM.
It is used to verify userid/pwd on the host system.
PyPAM is a universal package, it can be available on most distribution.
It can be available on el4~el6, f14~f19
http://pkgs.fedoraproject.org/cgit/PyPAM.git/

It is the same interface with python-pam.
but python-pam is not be available on rhel by pam
usage:
    from auth import authenticate
    authenticate(username, passwd)

Signed-off-by: ShaoHe Feng <shaohef@linux.vnet.ibm.com>
Signed-off-by: Shu Ming <shuming@linux.vnet.ibm.com>
IE8: The arrow indicator of dropdown menus can't be displayed

The arrow indicator of dropdown menus can't be displayed in IE8.

Signed-off-by: Xin Ding <xinding@linux.vnet.ibm.com>
adopt a single log convention

the python's logging.getLogger() can not write to the cherrypy
error_log file.

so we use cherrypy error_log instead of python's logging

Signed-off-by: ShaoHe Feng <shaohef@linux.vnet.ibm.com>
Issue #76 - ImportError: No module named discover

On RHEL with python2.6, even we install the unittest package,
we still run unittest normally, because the test discovery is
added from 2.7, so we must check the python version and use unit2
if under python2.6.

Signed-off-by: Bing Bu Cao <mars@linux.vnet.ibm.com>
build: Include extra top-level files in dist

Some top-level files are not currently included in the source
distribution (make dist) because automake has not been told about them.
autogen.sh is a shortcut for bootstrapping the autotools build
environment and the rest are documentation files.

Signed-off-by: Adam Litke <agl@linux.vnet.ibm.com>
bug fix: two python souce missing in distribution

kimchi complains about module utils and cachebust

Traceback (most recent call last):
File "/usr/bin/kimchid", line 31, in <module>
import kimchi.server
File "/usr/lib/python2.7/site-packages/kimchi/server.py", line 30, in <module>
import model
File "/usr/lib/python2.7/site-packages/kimchi/model.py", line 36, in <module>
import vmtemplate
File "/usr/lib/python2.7/site-packages/kimchi/vmtemplate.py", line 27, in <module>
import isoinfo
File "/usr/lib/python2.7/site-packages/kimchi/isoinfo.py", line 27, in <module>
from utils import kimchi_log
ImportError: No module named utils

[03/Sep/2013:21:36:32] HTTP Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/cherrypy/_cprequest.py", line 656, in respond
response.body = self.handler()
File "/usr/lib/python2.7/site-packages/cherrypy/lib/encoding.py", line 188, in __call__
self.body = self.oldhandler(*args, **kwargs)
File "/usr/lib/python2.7/site-packages/cherrypy/_cpdispatch.py", line 34, in __call__
return self.callable(*self.args, **self.kwargs)
File "/usr/lib/python2.7/site-packages/kimchi/controller.py", line 142, in index
return self.get()
File "/usr/lib/python2.7/site-packages/kimchi/root.py", line 54, in get
return self.default('kimchi-ui.html')
File "/usr/lib/python2.7/site-packages/kimchi/root.py", line 59, in default
return template.render(page, None)
File "/usr/lib/python2.7/site-packages/kimchi/template.py", line 90, in render
return Template(file=filename, searchList=params).respond()
File "/usr/lib64/python2.7/site-packages/Cheetah/Template.py", line 1259, in
__init__
self._compile(source, file, compilerSettings=compilerSettings)
File "/usr/lib64/python2.7/site-packages/Cheetah/Template.py", line
1553, in _compile
keepRefToGeneratedCode=True)
File "/usr/lib64/python2.7/site-packages/Cheetah/Template.py",
line 788, in compile
exec(co, mod.__dict__)
File "_usr_share_kimchi_ui_pages_kimchi_ui_html_tmpl.py",
line 27, in <module>
ImportError: No module named cachebust

Signed-off-by: apporc <appleorchard2000@gmail.com>
bug fix: add two dependencies in README.

When installing kimchi in  a minimal install of fedora 17 for the first time, we need gcc and make.

Signed-off-by: apporc <appleorchard2000@gmail.com>
api: Add an API to retrieve application configuration

To keep the UI and backend decoupled, we need an API for the UI to
access elements of the server configuration.  The first user of this
will be to allow an HTTPS instance of the server to redirect to the HTTP
instance (for VNC connections).  In the future we can extend this to
support capabilities reporting as well.

Signed-off-by: Adam Litke <agl@linux.vnet.ibm.com>
server: Support SSL connections
tests: Test the REST API using an SSL connection

Now that we have SSL support in the server, let's make sure to test it.
This patch makes some changes to the test utils so that SSL requests can
be done transparently.  Now test_rest runs through all tests twice: once
over http and a second time over https.

Signed-off-by: Adam Litke <agl@linux.vnet.ibm.com>
Catch InvalidOperation in collection

Because InvalidOperation is not caught in Collection,
when raise InvalidOperation, server 500 error occurs.
Make collection post catch this exception.

Signed-off-by: Royce Lv <lvroyce@linux.vnet.ibm.com>
Add testcase for InvalidOperation

Create resource with same name shoule raise 400 error
instead of 500 error.
Signed-off-by: Royce Lv <lvroyce@linux.vnet.ibm.com>
Signed-off-by: Adam Litke <agl@linux.vnet.ibm.com>
issue#110: Fix list storage volume for inactive pool

List storage volue with inactive pool raise 400 error.
Also change mock model to comply with libvirt behavior.

Signed-off-by: Shu Ming <shuming@linux.vnet.ibm.com>
Signed-off-by: Royce Lv <lvroyce@linux.vnet.ibm.com>
Signed-off-by: Adam Litke <agl@linux.vnet.ibm.com>
Add parentheses around dependency version in deb control file

The dependency version must be specified around parentheses.
Fix it.

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