Merge lp:~usrleon/nova/small_fixes into lp:~hudson-openstack/nova/trunk

Proposed by Max Lvov
Status: Work in progress
Proposed branch: lp:~usrleon/nova/small_fixes
Merge into: lp:~hudson-openstack/nova/trunk
Diff against target: 71 lines (+23/-5)
4 files modified
bin/nova-manage (+14/-0)
nova/CA/openssl.cnf.tmpl (+1/-1)
nova/service.py (+1/-1)
nova/utils.py (+7/-3)
To merge this branch: bzr merge lp:~usrleon/nova/small_fixes
Reviewer Review Type Date Requested Status
Josh Kearney (community) Needs Information
Devin Carlen (community) Approve
Review via email: mp+58934@code.launchpad.net

This proposal has been superseded by a proposal from 2011-05-04.

Description of the change

1 Set default paths for nova.conf and api-paste.ini to /etc/nova/
2 Changed countryName policy because https://bugs.launchpad.net/nova/+bug/724317 still affected.

To post a comment you must log in.
Revision history for this message
Jay Pipes (jaypipes) wrote :

Hi!

I'm not sure that I agree with changing the default location of nova.conf from the current working directory to /etc/nova. Generally, I think these kind of things belong more to the realm of packaging or configuration management, and specifying a location other than the current working directory assumes a certain setup. Granted, /etc/nova is standard deployment for configuration files, but I still think we should leave that up to the configuration management tool and/or packaging scripts...

The LDAP change I will politely defer to Ryan Lane or someone other LDAP expert (not me!) :)

Thoughts?

Revision history for this message
Vish Ishaya (vishvananda) wrote :

I agree in general with Jay's point. You can always specify the file on the command line as well.

The LDAP change seems fine, since match seems to have that weird issue where 'California' != 'California' for some reason.

Vish

On Apr 26, 2011, at 7:36 AM, Jay Pipes wrote:

> Hi!
>
> I'm not sure that I agree with changing the default location of nova.conf from the current working directory to /etc/nova. Generally, I think these kind of things belong more to the realm of packaging or configuration management, and specifying a location other than the current working directory assumes a certain setup. Granted, /etc/nova is standard deployment for configuration files, but I still think we should leave that up to the configuration management tool and/or packaging scripts...
>
> The LDAP change I will politely defer to Ryan Lane or someone other LDAP expert (not me!) :)
>
> Thoughts?
> --
> https://code.launchpad.net/~usrleon/nova/small_fixes/+merge/58934
> You are subscribed to branch lp:nova.

Revision history for this message
Max Lvov (usrleon) wrote :

I just tired type "--flagfile /etc/nova/nova.conf" and often forgot it, then I supposed Im not alone :)
Bug with openssl in my case possible caused russian locale on my system, but Im not sure.

Revision history for this message
Devin Carlen (devcamcar) wrote :

I actually like the change to the default flagfile location. In 99% of installations it's going to be in /etc/nova, and it causes a fair amount of confusion in the community. I wouldn't mind seeing this change go in.

review: Approve
Revision history for this message
Ilya Alekseyev (ilyaalekseyev) wrote :

Gents,

we have hyper-v virt driver in nova, but /etc/nova/nova.conf seems not very fair for windows.
Policy relaxation seems good.

Just 2 cents.

Revision history for this message
Max Lvov (usrleon) wrote :

Ok, I suggest 1034 instead 1031, but I not understand why it looks nova.conf in script directory, not current, home, etc.

Revision history for this message
Josh Kearney (jk0) wrote :

Why not have it look in both the current directory and /etc/nova? If there is no nova.conf in ., default to /etc/nova.

review: Needs Information
Revision history for this message
Max Lvov (usrleon) wrote :

Superseded for clarify target changes, sorry my mistakes with launchpad workflow.

Unmerged revisions

1036. By Max Lvov

default flagfile search in: scriptdir->current dir->/etc/nova

1035. By Max Lvov

'nova-manage image delete <image id or name>' function implementation

1034. By Max Lvov

default_flagfile in /etc if doesn't exist in script dir

1033. By Max Lvov

Default path for paste to /etc/nova/api-paste.ini

1032. By Max Lvov

countryName=supplied otherwise 'match' causes error in some cases

1031. By Max Lvov

default_flagfile full path

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/nova-manage'
2--- bin/nova-manage 2011-04-30 02:46:29 +0000
3+++ bin/nova-manage 2011-05-03 11:17:50 +0000
4@@ -1044,6 +1044,20 @@
5 self._convert_images(other_images)
6 self._convert_images(machine_images)
7
8+ def delete(self, image_id_or_name):
9+ """Removes image from image_service by id or name
10+ arguments: image id or name"""
11+ try:
12+ image = self.image_service.show(context, image_id_or_name)
13+ except exception.NotFound:
14+ try:
15+ image = self.image_service.show_by_name(context, image_id_or_name)
16+ except exception.NotFound:
17+ print "Can't find image '{}'".format(image_id_or_name)
18+ return
19+ self.image_service.delete(context, image['id'])
20+ print "Image id='{0}' name='{1}' deleted successfully".format(image['id'], image['name'])
21+
22
23 CATEGORIES = [
24 ('user', UserCommands),
25
26=== modified file 'nova/CA/openssl.cnf.tmpl'
27--- nova/CA/openssl.cnf.tmpl 2011-04-08 16:22:09 +0000
28+++ nova/CA/openssl.cnf.tmpl 2011-05-03 11:17:50 +0000
29@@ -46,7 +46,7 @@
30 # RHEL 6 and Fedora 14 (using openssl-1.0.0-4.el6.x86_64 or
31 # openssl-1.0.0d-1.fc14.x86_64)
32 [ policy_match ]
33-countryName = match
34+countryName = supplied
35 stateOrProvinceName = supplied
36 organizationName = optional
37 organizationalUnitName = optional
38
39=== modified file 'nova/service.py'
40--- nova/service.py 2011-04-20 19:08:22 +0000
41+++ nova/service.py 2011-05-03 11:17:50 +0000
42@@ -52,7 +52,7 @@
43 flags.DEFINE_string('osapi_listen', "0.0.0.0",
44 'IP address for OpenStack API to listen')
45 flags.DEFINE_integer('osapi_listen_port', 8774, 'port for os api to listen')
46-flags.DEFINE_string('api_paste_config', "api-paste.ini",
47+flags.DEFINE_string('api_paste_config', "/etc/nova/api-paste.ini",
48 'File name for the paste.deploy config for nova-api')
49
50
51
52=== modified file 'nova/utils.py'
53--- nova/utils.py 2011-04-22 19:44:24 +0000
54+++ nova/utils.py 2011-05-03 11:17:50 +0000
55@@ -232,9 +232,13 @@
56 # turn relative filename into an absolute path
57 script_dir = os.path.dirname(inspect.stack()[-1][1])
58 filename = os.path.abspath(os.path.join(script_dir, filename))
59- if os.path.exists(filename):
60- flagfile = ['--flagfile=%s' % filename]
61- sys.argv = sys.argv[:1] + flagfile + sys.argv[1:]
62+ if not os.path.exists(filename):
63+ filename = "./nova.conf"
64+ if not os.path.exists(filename):
65+ filename = '/etc/nova/nova.conf'
66+ flagfile = ['--flagfile=%s' % filename]
67+ sys.argv = sys.argv[:1] + flagfile + sys.argv[1:]
68+
69
70
71 def debug(arg):