summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Prince <dan.prince@rackspace.com>2011-04-06 15:36:58 -0400
committerDan Prince <dan.prince@rackspace.com>2011-04-06 15:36:58 -0400
commitb7f6deae7e3439c9e12bb54fcd18d9b06d5c1dce (patch)
tree4452a0f222c240ce82a43f369d4747b553deec79
parentaffb632be0c0054a7b0a4858c6e0a585cc1afd0d (diff)
parent134b1b4caa9df1cbba54b09625696e4f60147e05 (diff)
downloadnova-b7f6deae7e3439c9e12bb54fcd18d9b06d5c1dce.tar.gz
nova-b7f6deae7e3439c9e12bb54fcd18d9b06d5c1dce.tar.xz
nova-b7f6deae7e3439c9e12bb54fcd18d9b06d5c1dce.zip
Merge w/ trunk.
-rw-r--r--MANIFEST.in2
-rw-r--r--etc/nova/api-paste.ini (renamed from etc/api-paste.ini)0
-rw-r--r--nova/CA/.gitignore (renamed from CA/.gitignore)0
-rwxr-xr-xnova/CA/geninter.sh (renamed from CA/geninter.sh)2
-rwxr-xr-xnova/CA/genrootca.sh (renamed from CA/genrootca.sh)3
-rwxr-xr-xnova/CA/genvpn.sh (renamed from CA/genvpn.sh)0
-rw-r--r--nova/CA/newcerts/.placeholder (renamed from CA/newcerts/.placeholder)0
-rw-r--r--nova/CA/openssl.cnf.tmpl (renamed from CA/openssl.cnf.tmpl)0
-rw-r--r--nova/CA/private/.placeholder (renamed from CA/private/.placeholder)0
-rw-r--r--nova/CA/projects/.gitignore (renamed from CA/projects/.gitignore)0
-rw-r--r--nova/CA/projects/.placeholder (renamed from CA/projects/.placeholder)0
-rw-r--r--nova/CA/reqs/.gitignore (renamed from CA/reqs/.gitignore)0
-rw-r--r--nova/CA/reqs/.placeholder (renamed from CA/reqs/.placeholder)0
-rw-r--r--nova/api/ec2/cloud.py25
-rw-r--r--nova/crypto.py10
-rw-r--r--nova/virt/libvirt_conn.py3
-rw-r--r--nova/wsgi.py1
-rw-r--r--setup.py15
18 files changed, 47 insertions, 14 deletions
diff --git a/MANIFEST.in b/MANIFEST.in
index bf30d1546..e7a6e7da4 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,7 +1,7 @@
include HACKING LICENSE run_tests.py run_tests.sh
include README builddeb.sh exercise_rsapi.py
include ChangeLog MANIFEST.in pylintrc Authors
-graft CA
+graft nova/CA
graft doc
graft smoketests
graft tools
diff --git a/etc/api-paste.ini b/etc/nova/api-paste.ini
index abe8c20c4..abe8c20c4 100644
--- a/etc/api-paste.ini
+++ b/etc/nova/api-paste.ini
diff --git a/CA/.gitignore b/nova/CA/.gitignore
index fae0922bf..fae0922bf 100644
--- a/CA/.gitignore
+++ b/nova/CA/.gitignore
diff --git a/CA/geninter.sh b/nova/CA/geninter.sh
index 1fbcc9e73..4b7f5a55c 100755
--- a/CA/geninter.sh
+++ b/nova/CA/geninter.sh
@@ -23,7 +23,7 @@ mkdir -p projects/$NAME
cd projects/$NAME
cp ../../openssl.cnf.tmpl openssl.cnf
sed -i -e s/%USERNAME%/$NAME/g openssl.cnf
-mkdir certs crl newcerts private
+mkdir -p certs crl newcerts private
openssl req -new -x509 -extensions v3_ca -keyout private/cakey.pem -out cacert.pem -days 365 -config ./openssl.cnf -batch -nodes
echo "10" > serial
touch index.txt
diff --git a/CA/genrootca.sh b/nova/CA/genrootca.sh
index 8f2c3ee3f..091cf17fc 100755
--- a/CA/genrootca.sh
+++ b/nova/CA/genrootca.sh
@@ -20,8 +20,9 @@ if [ -f "cacert.pem" ];
then
echo "Not installing, it's already done."
else
- cp openssl.cnf.tmpl openssl.cnf
+ cp "$(dirname $0)/openssl.cnf.tmpl" openssl.cnf
sed -i -e s/%USERNAME%/ROOT/g openssl.cnf
+ mkdir -p certs crl newcerts private
openssl req -new -x509 -extensions v3_ca -keyout private/cakey.pem -out cacert.pem -days 365 -config ./openssl.cnf -batch -nodes
touch index.txt
echo "10" > serial
diff --git a/CA/genvpn.sh b/nova/CA/genvpn.sh
index 7e7db185d..7e7db185d 100755
--- a/CA/genvpn.sh
+++ b/nova/CA/genvpn.sh
diff --git a/CA/newcerts/.placeholder b/nova/CA/newcerts/.placeholder
index e69de29bb..e69de29bb 100644
--- a/CA/newcerts/.placeholder
+++ b/nova/CA/newcerts/.placeholder
diff --git a/CA/openssl.cnf.tmpl b/nova/CA/openssl.cnf.tmpl
index dd81f1c2b..dd81f1c2b 100644
--- a/CA/openssl.cnf.tmpl
+++ b/nova/CA/openssl.cnf.tmpl
diff --git a/CA/private/.placeholder b/nova/CA/private/.placeholder
index e69de29bb..e69de29bb 100644
--- a/CA/private/.placeholder
+++ b/nova/CA/private/.placeholder
diff --git a/CA/projects/.gitignore b/nova/CA/projects/.gitignore
index 72e8ffc0d..72e8ffc0d 100644
--- a/CA/projects/.gitignore
+++ b/nova/CA/projects/.gitignore
diff --git a/CA/projects/.placeholder b/nova/CA/projects/.placeholder
index e69de29bb..e69de29bb 100644
--- a/CA/projects/.placeholder
+++ b/nova/CA/projects/.placeholder
diff --git a/CA/reqs/.gitignore b/nova/CA/reqs/.gitignore
index 72e8ffc0d..72e8ffc0d 100644
--- a/CA/reqs/.gitignore
+++ b/nova/CA/reqs/.gitignore
diff --git a/CA/reqs/.placeholder b/nova/CA/reqs/.placeholder
index e69de29bb..e69de29bb 100644
--- a/CA/reqs/.placeholder
+++ b/nova/CA/reqs/.placeholder
diff --git a/nova/api/ec2/cloud.py b/nova/api/ec2/cloud.py
index 425784e8a..58effd134 100644
--- a/nova/api/ec2/cloud.py
+++ b/nova/api/ec2/cloud.py
@@ -103,10 +103,18 @@ class CloudController(object):
# Gen root CA, if we don't have one
root_ca_path = os.path.join(FLAGS.ca_path, FLAGS.ca_file)
if not os.path.exists(root_ca_path):
+ genrootca_sh_path = os.path.join(os.path.dirname(__file__),
+ os.path.pardir,
+ os.path.pardir,
+ 'CA',
+ 'genrootca.sh')
+
start = os.getcwd()
+ if not os.path.exists(FLAGS.ca_path):
+ os.makedirs(FLAGS.ca_path)
os.chdir(FLAGS.ca_path)
# TODO(vish): Do this with M2Crypto instead
- utils.runthis(_("Generating root CA: %s"), "sh", "genrootca.sh")
+ utils.runthis(_("Generating root CA: %s"), "sh", genrootca_sh_path)
os.chdir(start)
def _get_mpi_data(self, context, project_id):
@@ -886,10 +894,7 @@ class CloudController(object):
image_type = image['properties'].get('type')
ec2_id = self._image_ec2_id(image.get('id'), image_type)
name = image.get('name')
- if name:
- i['imageId'] = "%s (%s)" % (ec2_id, name)
- else:
- i['imageId'] = ec2_id
+ i['imageId'] = ec2_id
kernel_id = image['properties'].get('kernel_id')
if kernel_id:
i['kernelId'] = self._image_ec2_id(kernel_id, 'kernel')
@@ -897,11 +902,15 @@ class CloudController(object):
if ramdisk_id:
i['ramdiskId'] = self._image_ec2_id(ramdisk_id, 'ramdisk')
i['imageOwnerId'] = image['properties'].get('owner_id')
- i['imageLocation'] = image['properties'].get('image_location')
+ if name:
+ i['imageLocation'] = "%s (%s)" % (image['properties'].
+ get('image_location'), name)
+ else:
+ i['imageLocation'] = image['properties'].get('image_location')
i['imageState'] = image['properties'].get('image_state')
- i['displayName'] = image.get('name')
+ i['displayName'] = name
i['description'] = image.get('description')
- i['type'] = image_type
+ i['imageType'] = image_type
i['isPublic'] = str(image['properties'].get('is_public', '')) == 'True'
i['architecture'] = image['properties'].get('architecture')
return i
diff --git a/nova/crypto.py b/nova/crypto.py
index b112e5b92..2b122e560 100644
--- a/nova/crypto.py
+++ b/nova/crypto.py
@@ -215,9 +215,12 @@ def generate_x509_cert(user_id, project_id, bits=1024):
def _ensure_project_folder(project_id):
if not os.path.exists(ca_path(project_id)):
+ geninter_sh_path = os.path.join(os.path.dirname(__file__),
+ 'CA',
+ 'geninter.sh')
start = os.getcwd()
os.chdir(ca_folder())
- utils.execute('sh', 'geninter.sh', project_id,
+ utils.execute('sh', geninter_sh_path, project_id,
_project_cert_subject(project_id))
os.chdir(start)
@@ -227,13 +230,16 @@ def generate_vpn_files(project_id):
csr_fn = os.path.join(project_folder, "server.csr")
crt_fn = os.path.join(project_folder, "server.crt")
+ genvpn_sh_path = os.path.join(os.path.dirname(__file__),
+ 'CA',
+ 'geninter.sh')
if os.path.exists(crt_fn):
return
_ensure_project_folder(project_id)
start = os.getcwd()
os.chdir(ca_folder())
# TODO(vish): the shell scripts could all be done in python
- utils.execute('sh', 'genvpn.sh',
+ utils.execute('sh', genvpn_sh_path,
project_id, _vpn_cert_subject(project_id))
with open(csr_fn, "r") as csrfile:
csr_text = csrfile.read()
diff --git a/nova/virt/libvirt_conn.py b/nova/virt/libvirt_conn.py
index babbc610d..2be190256 100644
--- a/nova/virt/libvirt_conn.py
+++ b/nova/virt/libvirt_conn.py
@@ -970,7 +970,8 @@ class LibvirtConnection(driver.ComputeDriver):
'nics': nics}
if FLAGS.vnc_enabled:
- xml_info['vncserver_host'] = FLAGS.vncserver_host
+ if FLAGS.libvirt_type != 'lxc':
+ xml_info['vncserver_host'] = FLAGS.vncserver_host
if not rescue:
if instance['kernel_id']:
xml_info['kernel'] = xml_info['basepath'] + "/kernel"
diff --git a/nova/wsgi.py b/nova/wsgi.py
index ba0819466..05e7d5924 100644
--- a/nova/wsgi.py
+++ b/nova/wsgi.py
@@ -532,6 +532,7 @@ def paste_config_file(basename):
"""
configfiles = [basename,
+ os.path.join(FLAGS.state_path, 'etc', 'nova', basename),
os.path.join(FLAGS.state_path, 'etc', basename),
os.path.join(FLAGS.state_path, basename),
'/etc/nova/%s' % basename]
diff --git a/setup.py b/setup.py
index 20f4c1947..6c45109bc 100644
--- a/setup.py
+++ b/setup.py
@@ -16,6 +16,7 @@
# License for the specific language governing permissions and limitations
# under the License.
+import glob
import os
import subprocess
import sys
@@ -86,6 +87,19 @@ try:
except:
pass
+
+def find_data_files(destdir, srcdir):
+ package_data = []
+ files = []
+ for d in glob.glob('%s/*' % (srcdir, )):
+ if os.path.isdir(d):
+ package_data += find_data_files(
+ os.path.join(destdir, os.path.basename(d)), d)
+ else:
+ files += [d]
+ package_data += [(destdir, files)]
+ return package_data
+
DistUtilsExtra.auto.setup(name='nova',
version=version.canonical_version_string(),
description='cloud computing fabric controller',
@@ -96,6 +110,7 @@ DistUtilsExtra.auto.setup(name='nova',
packages=find_packages(exclude=['bin', 'smoketests']),
include_package_data=True,
test_suite='nose.collector',
+ data_files=find_data_files('share/nova', 'tools'),
scripts=['bin/nova-ajax-console-proxy',
'bin/nova-api',
'bin/nova-compute',