From a90ca32ab9c75927efe6e92bd4add05ef57c2cb1 Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Wed, 23 Jun 2010 23:16:25 -0700 Subject: Installer now creates global developer role --- nova/auth/slap.sh | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'nova') diff --git a/nova/auth/slap.sh b/nova/auth/slap.sh index 277ae2bcd..90dc7a9d6 100755 --- a/nova/auth/slap.sh +++ b/nova/auth/slap.sh @@ -221,6 +221,12 @@ objectClass: simpleSecurityObject # create the sysadmin entry +dn: cn=developers,ou=Groups,dc=example,dc=com +objectclass: groupOfNames +cn: developers +description: IT admin group +member: uid=admin,ou=Users,dc=example,dc=com + dn: cn=sysadmins,ou=Groups,dc=example,dc=com objectclass: groupOfNames cn: sysadmins -- cgit From fb783d7fde342901db25733f917c666811fe30b2 Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Wed, 23 Jun 2010 23:16:25 -0700 Subject: Fix error message for checking for projectmanager role --- nova/auth/users.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'nova') diff --git a/nova/auth/users.py b/nova/auth/users.py index 6997596aa..1896abd9d 100644 --- a/nova/auth/users.py +++ b/nova/auth/users.py @@ -349,7 +349,9 @@ class UserManager(object): def has_role(self, user, role, project=None): with LDAPWrapper() as conn: - if project and role == 'projectmanager': + if role == 'projectmanager': + if not project: + raise exception.Error("Must specify project") return self.is_project_manager(user, project) global_role = conn.has_role(User.safe_id(user), -- cgit From f119ca5798ab9c5d1190a125fce1aa25c24967ad Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Wed, 23 Jun 2010 23:16:25 -0700 Subject: Fix deletion of user when he is the last member of the group --- nova/auth/users.py | 41 +++++++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 14 deletions(-) (limited to 'nova') diff --git a/nova/auth/users.py b/nova/auth/users.py index 1896abd9d..e2e18175d 100644 --- a/nova/auth/users.py +++ b/nova/auth/users.py @@ -515,6 +515,14 @@ class LDAPWrapper(object): return None return objects[0] + def find_dns(self, dn, query = None): + try: + res = self.conn.search_s(dn, ldap.SCOPE_SUBTREE, query) + except Exception: + return [] + # just return the dns + return [x[0] for x in res] + def find_objects(self, dn, query = None): try: res = self.conn.search_s(dn, ldap.SCOPE_SUBTREE, query) @@ -539,9 +547,11 @@ class LDAPWrapper(object): attrs = self.find_objects(tree, '(&(objectclass=groupOfNames)(!(objectclass=NovaProject)))') return [self.__to_group(attr) for attr in attrs] - def find_groups_with_member(self, tree, dn): - attrs = self.find_objects(tree, '(&(objectclass=groupOfNames)(member=%s))' % dn ) - return [self.__to_group(attr) for attr in attrs] + def find_group_dns_with_member(self, tree, uid): + dns = self.find_dns(tree, + '(&(objectclass=groupOfNames)(member=%s))' % + self.__uid_to_dn(uid) ) + return dns def find_user(self, uid): attr = self.find_object(self.__uid_to_dn(uid), '(objectclass=novaUser)') @@ -717,29 +727,32 @@ class LDAPWrapper(object): raise exception.NotFound("User %s can't be removed from the group because the user doesn't exist" % (uid,)) if not self.is_in_group(uid, group_dn): raise exception.NotFound("User %s is not a member of the group" % (uid,)) + self._safe_remove_from_group(group_dn, uid) + + def _safe_remove_from_group(self, group_dn, uid): + # FIXME(vish): what if deleted user is a project manager? attr = [ (ldap.MOD_DELETE, 'member', self.__uid_to_dn(uid)) ] try: self.conn.modify_s(group_dn, attr) except ldap.OBJECT_CLASS_VIOLATION: - logging.debug("Attempted to remove the last member of a group. Deleting the group instead.") + logging.debug("Attempted to remove the last member of a group. " + "Deleting the group at %s instead." % group_dn ) self.delete_group(group_dn) def remove_from_all(self, uid): - # FIXME(vish): what if deleted user is a project manager? if not self.user_exists(uid): raise exception.NotFound("User %s can't be removed from all because the user doesn't exist" % (uid,)) dn = self.__uid_to_dn(uid) - attr = [ - (ldap.MOD_DELETE, 'member', dn) - ] - roles = self.find_groups_with_member(FLAGS.role_ldap_subtree, dn) - for role in roles: - self.conn.modify_s('cn=%s,%s' % (role.id, FLAGS.role_ldap_subtree), attr) - projects = self.find_groups_with_member(FLAGS.project_ldap_subtree, dn) - for project in projects: - self.conn.modify_s('cn=%s,%s' % (project.id, FLAGS.project_ldap_subtree), attr) + role_dns = self.find_group_dns_with_member( + FLAGS.role_ldap_subtree, uid) + for role_dn in role_dns: + self._safe_remove_from_group(role_dn, uid) + project_dns = self.find_group_dns_with_member( + FLAGS.project_ldap_subtree, uid) + for project_dn in project_dns: + self._safe_remove_from_group(project_dn, uid) def create_key_pair(self, uid, key_name, public_key, fingerprint): """create's a public key in the directory underneath the user""" -- cgit From 6242413372d5b4540bfdeb33eaaa852fa689fd6f Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Wed, 23 Jun 2010 23:24:38 -0700 Subject: Fix queue connection bugs Fix logging if queue disconnects Reconnect if queue comes back --- nova/rpc.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'nova') diff --git a/nova/rpc.py b/nova/rpc.py index 54843973a..3019beba0 100644 --- a/nova/rpc.py +++ b/nova/rpc.py @@ -63,6 +63,10 @@ class Connection(connection.BrokerConnection): cls._instance = cls(**params) return cls._instance + @classmethod + def recreate(cls): + del cls._instance + return cls.instance() class Consumer(messaging.Consumer): # TODO(termie): it would be nice to give these some way of automatically @@ -79,9 +83,20 @@ class Consumer(messaging.Consumer): attachToTornado = attach_to_tornado - @exception.wrap_exception def fetch(self, *args, **kwargs): - super(Consumer, self).fetch(*args, **kwargs) + try: + if getattr(self, 'failed_connection', False): + # attempt to reconnect + self.conn = Connection.recreate() + self.backend = self.conn.create_backend() + super(Consumer, self).fetch(*args, **kwargs) + if getattr(self, 'failed_connection', False): + logging.error("Reconnected to queue") + self.failed_connection = False + except Exception, ex: + if not getattr(self, 'failed_connection', False): + logging.exception("Failed to fetch message from queue") + self.failed_connection = True def attach_to_twisted(self): loop = task.LoopingCall(self.fetch, enable_callbacks=True) -- cgit From 884ed0c43130a49ce8f230833ff5d9dd830d4a8a Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Wed, 23 Jun 2010 23:28:32 -0700 Subject: removed extraneous reference to rpc in objectstore unit test --- nova/tests/objectstore_unittest.py | 2 -- 1 file changed, 2 deletions(-) (limited to 'nova') diff --git a/nova/tests/objectstore_unittest.py b/nova/tests/objectstore_unittest.py index 89c1d59c5..cee567c8b 100644 --- a/nova/tests/objectstore_unittest.py +++ b/nova/tests/objectstore_unittest.py @@ -28,7 +28,6 @@ import tempfile from nova import vendor from nova import flags -from nova import rpc from nova import objectstore from nova import test from nova.auth import users @@ -57,7 +56,6 @@ class ObjectStoreTestCase(test.BaseTestCase): buckets_path=os.path.join(oss_tempdir, 'buckets'), images_path=os.path.join(oss_tempdir, 'images'), ca_path=os.path.join(os.path.dirname(__file__), 'CA')) - self.conn = rpc.Connection.instance() logging.getLogger().setLevel(logging.DEBUG) self.um = users.UserManager.instance() -- cgit From 8384fe99a75552cb8aa7ae3c4d4b7f7318770d41 Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Wed, 23 Jun 2010 23:30:14 -0700 Subject: fit comment within 80 lines --- nova/rpc.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'nova') diff --git a/nova/rpc.py b/nova/rpc.py index 54843973a..032edf79a 100644 --- a/nova/rpc.py +++ b/nova/rpc.py @@ -115,9 +115,10 @@ class AdapterConsumer(TopicConsumer): args = message_data.get('args', {}) message.ack() if not method: - # vish: we may not want to ack here, but that means that bad messages - # stay in the queue indefinitely, so for now we just log the - # message and send an error string back to the caller + # vish: we may not want to ack here, but that means that bad + # messages stay in the queue indefinitely, so for now + # we just log the message and send an error string back + # to the caller _log.warn('no method for message: %s' % (message_data)) msg_reply(msg_id, 'No method for message: %s' % message_data) return -- cgit From badef85b2ceb7121068da8f86507bdee863df44c Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Wed, 23 Jun 2010 23:50:33 -0700 Subject: more comment reformatting --- nova/rpc.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'nova') diff --git a/nova/rpc.py b/nova/rpc.py index 032edf79a..43713bd5f 100644 --- a/nova/rpc.py +++ b/nova/rpc.py @@ -115,10 +115,10 @@ class AdapterConsumer(TopicConsumer): args = message_data.get('args', {}) message.ack() if not method: - # vish: we may not want to ack here, but that means that bad - # messages stay in the queue indefinitely, so for now - # we just log the message and send an error string back - # to the caller + # NOTE(vish): we may not want to ack here, but that means that bad + # messages stay in the queue indefinitely, so for now + # we just log the message and send an error string + # back to the caller _log.warn('no method for message: %s' % (message_data)) msg_reply(msg_id, 'No method for message: %s' % message_data) return -- cgit From c3dea0b61fc38e9a42d2d0966afbe5386a9ba2da Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Thu, 24 Jun 2010 11:16:11 -0700 Subject: Placeholders for missing describe commands --- nova/endpoint/cloud.py | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'nova') diff --git a/nova/endpoint/cloud.py b/nova/endpoint/cloud.py index d6c164163..992a6a803 100644 --- a/nova/endpoint/cloud.py +++ b/nova/endpoint/cloud.py @@ -169,6 +169,28 @@ class CloudController(object): return {'availabilityZoneInfo': [{'zoneName': 'nova', 'zoneState': 'available'}]} + @rbac.allow('all') + def describe_regions(self, context, region_name=None, **kwargs): + # TODO(vish): region_name is an array. Support filtering + return {'regionInfo': [{'regionName': 'nova', + 'regionUrl': FLAGS.ec2_url}]} + + @rbac.allow('all') + def describe_snapshots(self, + context, + snapshot_id=None, + owner=None, + restorable_by=None, + **kwargs): + return {'snapshotSet': [{'snapshotId': 'fixme', + 'volumeId': 'fixme', + 'status': 'fixme', + 'startTime': 'fixme', + 'progress': 'fixme', + 'ownerId': 'fixme', + 'volumeSize': 0, + 'description': 'fixme'}]} + @rbac.allow('all') def describe_key_pairs(self, context, key_name=None, **kwargs): key_pairs = context.user.get_key_pairs() @@ -609,9 +631,8 @@ class CloudController(object): result = { 'image_id': image_id, 'launchPermission': [] } if image['isPublic']: result['launchPermission'].append({ 'group': 'all' }) - return defer.succeed(result) - + @rbac.allow('projectmanager', 'sysadmin') def modify_image_attribute(self, context, image_id, attribute, operation_type, **kwargs): # TODO(devcamcar): Support users and groups other than 'all'. -- cgit From 6d8d59180088ec8855e088a217b58b741f34aac4 Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Thu, 24 Jun 2010 20:59:16 -0700 Subject: don't fail to create vpn key if dir exists --- nova/cloudpipe/pipelib.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'nova') diff --git a/nova/cloudpipe/pipelib.py b/nova/cloudpipe/pipelib.py index 09da71c64..cec3e5dca 100644 --- a/nova/cloudpipe/pipelib.py +++ b/nova/cloudpipe/pipelib.py @@ -81,7 +81,8 @@ class CloudPipe(object): private_key, fingerprint = self.manager.generate_key_pair(user_id, key_name) try: key_dir = os.path.join(FLAGS.keys_path, user_id) - os.makedirs(key_dir) + if not os.path.exists(key_dir): + os.makedirs(key_dir) with open(os.path.join(key_dir, '%s.pem' % key_name),'w') as f: f.write(private_key) except: -- cgit From 70099adaab238d34c68947e00350df84e83d2270 Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Thu, 24 Jun 2010 21:04:55 -0700 Subject: Use flag for vpn key suffix instead of hardcoded string --- nova/cloudpipe/pipelib.py | 2 +- nova/endpoint/cloud.py | 7 ++++--- nova/flags.py | 4 ++++ 3 files changed, 9 insertions(+), 4 deletions(-) (limited to 'nova') diff --git a/nova/cloudpipe/pipelib.py b/nova/cloudpipe/pipelib.py index cec3e5dca..5f6ccf82e 100644 --- a/nova/cloudpipe/pipelib.py +++ b/nova/cloudpipe/pipelib.py @@ -76,7 +76,7 @@ class CloudPipe(object): zippy.close() def setup_keypair(self, user_id, project_id): - key_name = '%s-key' % project_id + key_name = '%s%s' % (project_id, FLAGS.vpn_key_suffix) try: private_key, fingerprint = self.manager.generate_key_pair(user_id, key_name) try: diff --git a/nova/endpoint/cloud.py b/nova/endpoint/cloud.py index d6c164163..8eaa8213b 100644 --- a/nova/endpoint/cloud.py +++ b/nova/endpoint/cloud.py @@ -178,7 +178,8 @@ class CloudController(object): result = [] for key_pair in key_pairs: # filter out the vpn keys - if context.user.is_admin() or not key_pair.name.endswith('-key'): + suffix = FLAGS.vpn_key_suffix + if context.user.is_admin() or not key_pair.name.endswith(suffix): result.append({ 'keyName': key_pair.name, 'keyFingerprint': key_pair.fingerprint, @@ -609,9 +610,9 @@ class CloudController(object): result = { 'image_id': image_id, 'launchPermission': [] } if image['isPublic']: result['launchPermission'].append({ 'group': 'all' }) - + return defer.succeed(result) - + @rbac.allow('projectmanager', 'sysadmin') def modify_image_attribute(self, context, image_id, attribute, operation_type, **kwargs): # TODO(devcamcar): Support users and groups other than 'all'. diff --git a/nova/flags.py b/nova/flags.py index bf7b6e3a3..396276ea1 100644 --- a/nova/flags.py +++ b/nova/flags.py @@ -75,6 +75,10 @@ DEFINE_string('default_instance_type', DEFINE_string('vpn_image_id', 'ami-CLOUDPIPE', 'AMI for cloudpipe vpn server') +flags.DEFINE_string('vpn_key_suffix', + '-key', + 'Suffix to add to project name for vpn key') + # UNUSED DEFINE_string('node_availability_zone', 'nova', -- cgit From 6a97550633a0ec266be08f8cba4f8d515778c4f2 Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Fri, 25 Jun 2010 10:09:21 -0700 Subject: style cleanup --- nova/auth/users.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'nova') diff --git a/nova/auth/users.py b/nova/auth/users.py index e2e18175d..fae0d0953 100644 --- a/nova/auth/users.py +++ b/nova/auth/users.py @@ -515,13 +515,13 @@ class LDAPWrapper(object): return None return objects[0] - def find_dns(self, dn, query = None): + def find_dns(self, dn, query=None): try: res = self.conn.search_s(dn, ldap.SCOPE_SUBTREE, query) except Exception: return [] - # just return the dns - return [x[0] for x in res] + # just return the DNs + return [dn for dn, attributes in res] def find_objects(self, dn, query = None): try: @@ -529,7 +529,7 @@ class LDAPWrapper(object): except Exception: return [] # just return the attributes - return [x[1] for x in res] + return [attributes for dn, attributes in res] def find_users(self): attrs = self.find_objects(FLAGS.user_ldap_subtree, '(objectclass=novaUser)') @@ -550,7 +550,7 @@ class LDAPWrapper(object): def find_group_dns_with_member(self, tree, uid): dns = self.find_dns(tree, '(&(objectclass=groupOfNames)(member=%s))' % - self.__uid_to_dn(uid) ) + self.__uid_to_dn(uid)) return dns def find_user(self, uid): @@ -731,9 +731,7 @@ class LDAPWrapper(object): def _safe_remove_from_group(self, group_dn, uid): # FIXME(vish): what if deleted user is a project manager? - attr = [ - (ldap.MOD_DELETE, 'member', self.__uid_to_dn(uid)) - ] + attr = [(ldap.MOD_DELETE, 'member', self.__uid_to_dn(uid))] try: self.conn.modify_s(group_dn, attr) except ldap.OBJECT_CLASS_VIOLATION: @@ -746,11 +744,11 @@ class LDAPWrapper(object): raise exception.NotFound("User %s can't be removed from all because the user doesn't exist" % (uid,)) dn = self.__uid_to_dn(uid) role_dns = self.find_group_dns_with_member( - FLAGS.role_ldap_subtree, uid) + FLAGS.role_ldap_subtree, uid) for role_dn in role_dns: self._safe_remove_from_group(role_dn, uid) project_dns = self.find_group_dns_with_member( - FLAGS.project_ldap_subtree, uid) + FLAGS.project_ldap_subtree, uid) for project_dn in project_dns: self._safe_remove_from_group(project_dn, uid) -- cgit From 4b3a0ad09056c8cc6159b0781b558d2636666629 Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Fri, 25 Jun 2010 10:15:42 -0700 Subject: fixed typo --- nova/flags.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'nova') diff --git a/nova/flags.py b/nova/flags.py index 396276ea1..985f9ba04 100644 --- a/nova/flags.py +++ b/nova/flags.py @@ -74,10 +74,9 @@ DEFINE_string('default_instance_type', 'default instance type to use, testing only') DEFINE_string('vpn_image_id', 'ami-CLOUDPIPE', 'AMI for cloudpipe vpn server') - -flags.DEFINE_string('vpn_key_suffix', - '-key', - 'Suffix to add to project name for vpn key') +DEFINE_string('vpn_key_suffix', + '-key', + 'Suffix to add to project name for vpn key') # UNUSED DEFINE_string('node_availability_zone', -- cgit From 78e7700e15e75545bd5d85199ab6e126bc7d4a59 Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Fri, 25 Jun 2010 17:36:48 -0700 Subject: added TODO --- nova/rpc.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'nova') diff --git a/nova/rpc.py b/nova/rpc.py index 3019beba0..8c66c6b73 100644 --- a/nova/rpc.py +++ b/nova/rpc.py @@ -84,6 +84,8 @@ class Consumer(messaging.Consumer): attachToTornado = attach_to_tornado def fetch(self, *args, **kwargs): + # TODO(vish): the logic for failed connections and logging should be + # refactored into some sort of connection manager object try: if getattr(self, 'failed_connection', False): # attempt to reconnect -- cgit From 543d9792b48909eefe1b3a67e83e0412800c60d7 Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Sat, 26 Jun 2010 14:50:33 -0700 Subject: fix key injection script --- nova/compute/disk.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'nova') diff --git a/nova/compute/disk.py b/nova/compute/disk.py index e7090dad3..bd6a010ee 100644 --- a/nova/compute/disk.py +++ b/nova/compute/disk.py @@ -36,7 +36,7 @@ from nova import exception def partition(infile, outfile, local_bytes=0, local_type='ext2', execute=None): """Takes a single partition represented by infile and writes a bootable drive image into outfile. - + The first 63 sectors (0-62) of the resulting image is a master boot record. Infile becomes the first primary partition. If local bytes is specified, a second primary partition is created and @@ -142,5 +142,5 @@ def _inject_into_fs(key, fs, execute=None): yield execute('sudo chown root %s' % sshdir) yield execute('sudo chmod 700 %s' % sshdir) keyfile = os.path.join(sshdir, 'authorized_keys') - yield execute('sudo bash -c "cat >> %s"' % keyfile, '\n' + key + '\n') + yield execute('sudo tee -a %s' % keyfile, '\n' + key.strip() + '\n') -- cgit From 973e45e62df73138d53600bc44a51ac1be409e07 Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Sun, 27 Jun 2010 23:19:14 -0700 Subject: Make fakeldap use redis --- nova/auth/fakeldap.py | 132 ++++++++++++++++++++++++++++---------------------- 1 file changed, 74 insertions(+), 58 deletions(-) (limited to 'nova') diff --git a/nova/auth/fakeldap.py b/nova/auth/fakeldap.py index 27dde314d..0e95972f2 100644 --- a/nova/auth/fakeldap.py +++ b/nova/auth/fakeldap.py @@ -21,37 +21,31 @@ Fake LDAP server for test harnesses. """ -import logging +import json from nova import datastore -SCOPE_SUBTREE = 1 +SCOPE_SUBTREE = 2 MOD_ADD = 0 MOD_DELETE = 1 -SUBS = { - 'groupOfNames': ['novaProject'] -} - class NO_SUCH_OBJECT(Exception): pass def initialize(uri): - return FakeLDAP(uri) + return FakeLDAP() class FakeLDAP(object): - def __init__(self, _uri): - self.keeper = datastore.Keeper('fakeldap') - if self.keeper['objects'] is None: - self.keeper['objects'] = {} def simple_bind_s(self, dn, password): + """This method is ignored, but provided for compatibility""" pass def unbind_s(self): + """This method is ignored, but provided for compatibility""" pass def _paren_groups(self, source): @@ -67,6 +61,7 @@ class FakeLDAP(object): count -= 1 if count == 0: result.append(source[start:pos+1]) + return result def _match_query(self, query, attrs): inner = query[1:-1] @@ -83,63 +78,84 @@ class FakeLDAP(object): return self._match(k, v, attrs) def _subs(self, v): - if v in SUBS: - return [v] + SUBS[v] + subs = { + 'groupOfNames': ['novaProject'] + } + if v in subs: + return [v] + subs[v] return [v] def _match(self, k, v, attrs): if attrs.has_key(k): for v in self._subs(v): - if (v in attrs[k]): + if v in attrs[k]: return True return False + def search_s(self, dn, scope, query=None, fields=None): - #logging.debug("searching for %s" % dn) - filtered = {} - d = self.keeper['objects'] or {} - for cn, attrs in d.iteritems(): - if cn[-len(dn):] == dn: - filtered[cn] = attrs - objects = filtered - if query: - objects = {} - for cn, attrs in filtered.iteritems(): - if self._match_query(query, attrs): - objects[cn] = attrs - if objects == {}: + """search for all matching objects under dn using the query + only SCOPE_SUBTREE is supported. + """ + if scope != SCOPE_SUBTREE: + raise NotImplementedError(str(scope)) + redis = datastore.Redis.instance() + keys = redis.keys(self._redis_prefix + '*' + dn) + objects = [] + for key in keys: + # get the attributes from redis + attrs = redis.hgetall(key) + # turn the values from redis into lists + attrs = dict([(k, self._from_json(v)) + for k, v in attrs.iteritems()]) + # filter the objects by query + if not query or self._match_query(query, attrs): + # filter the attributes by fields + attrs = dict([(k, v) for k, v in attrs.iteritems() + if not fields or k in fields]) + objects.append((key[len(self._redis_prefix):], attrs)) + if objects == []: raise NO_SUCH_OBJECT() - return objects.items() - - def add_s(self, cn, attr): - #logging.debug("adding %s" % cn) - stored = {} - for k, v in attr: - if type(v) is list: - stored[k] = v - else: - stored[k] = [v] - d = self.keeper['objects'] - d[cn] = stored - self.keeper['objects'] = d - - def delete_s(self, cn): - logging.debug("deleting %s" % cn) - d = self.keeper['objects'] - del d[cn] - self.keeper['objects'] = d - - def modify_s(self, cn, attr): - logging.debug("modifying %s" % cn) - d = self.keeper['objects'] - for cmd, k, v in attr: - logging.debug("command %s" % cmd) + return objects + + @property + def _redis_prefix(self): + return 'ldap:' + + def _from_json(self, encoded): + """Convert attribute values from json representation.""" + # return as simple strings instead of unicode strings + return [str(x) for x in json.loads(encoded)] + + def _to_json(self, unencoded): + """Convert attribute values into json representation.""" + # all values are returned as lists from ldap + return json.dumps(list(unencoded)) + + def add_s(self, dn, attr): + """Add an object with the specified attributes at dn.""" + key = self._redis_prefix + dn + + value_dict = dict([(k, self._to_json(v)) for k, v in attr]) + datastore.Redis.instance().hmset(key, value_dict) + + def delete_s(self, dn): + """Remove the ldap object at specified dn.""" + datastore.Redis.instance().delete(self._redis_prefix + dn) + + def modify_s(self, dn, attrs): + """Modify the object at dn using the attribute list. + attr is a list of tuples in the following form: + ([MOD_ADD | MOD_DELETE], attribute, value) + """ + redis = datastore.Redis.instance() + key = self._redis_prefix + dn + + for cmd, k, v in attrs: + values = self._from_json(redis.hget(key, k)) if cmd == MOD_ADD: - d[cn][k].append(v) + values.append(v) else: - d[cn][k].remove(v) - self.keeper['objects'] = d - - - + values.remove(v) + values = redis.hset(key, k, self._to_json(values)) -- cgit From 4bb9e67582b2e2b6302b889011baffb69cff79c3 Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Sun, 27 Jun 2010 23:20:38 -0700 Subject: users.py cleanup for exception handling and typo --- nova/auth/users.py | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'nova') diff --git a/nova/auth/users.py b/nova/auth/users.py index fae0d0953..64457d3c0 100644 --- a/nova/auth/users.py +++ b/nova/auth/users.py @@ -502,7 +502,9 @@ class LDAPWrapper(object): def connect(self): """ connect to ldap as admin user """ + global ldap if FLAGS.fake_users: + import fakeldap as ldap self.conn = fakeldap.initialize(FLAGS.ldap_url) else: assert(ldap.__name__ != 'fakeldap') @@ -518,7 +520,7 @@ class LDAPWrapper(object): def find_dns(self, dn, query=None): try: res = self.conn.search_s(dn, ldap.SCOPE_SUBTREE, query) - except Exception: + except ldap.NO_SUCH_OBJECT: return [] # just return the DNs return [dn for dn, attributes in res] @@ -526,7 +528,7 @@ class LDAPWrapper(object): def find_objects(self, dn, query = None): try: res = self.conn.search_s(dn, ldap.SCOPE_SUBTREE, query) - except Exception: + except ldap.NO_SUCH_OBJECT: return [] # just return the attributes return [attributes for dn, attributes in res] @@ -544,7 +546,7 @@ class LDAPWrapper(object): return [self.__to_project(attr) for attr in attrs] def find_roles(self, tree): - attrs = self.find_objects(tree, '(&(objectclass=groupOfNames)(!(objectclass=NovaProject)))') + attrs = self.find_objects(tree, '(&(objectclass=groupOfNames)(!(objectclass=novaProject)))') return [self.__to_group(attr) for attr in attrs] def find_group_dns_with_member(self, tree, uid): @@ -693,11 +695,7 @@ class LDAPWrapper(object): def remove_role(self, uid, role, project_id=None): role_dn = self.__role_to_dn(role, project_id) - try: - return self.remove_from_group(uid, role_dn) - except Exception, ex: - print type(ex), ex - + return self.remove_from_group(uid, role_dn) def is_in_group(self, uid, group_dn): if not self.user_exists(uid): @@ -794,9 +792,8 @@ class LDAPWrapper(object): def delete_roles(self, project_dn): roles = self.find_roles(project_dn) - if roles != None: - for role in roles: - self.delete_group('cn=%s,%s' % (role.id, project_dn)) + for role in roles: + self.delete_group('cn=%s,%s' % (role.id, project_dn)) def delete_project(self, name): project_dn = 'cn=%s,%s' % (name, FLAGS.project_ldap_subtree) -- cgit From 974ecad2092502cc6825ed5c4c7daa1b362f8a41 Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Sun, 27 Jun 2010 23:47:04 -0700 Subject: More Comments, cleanup, and reformatting --- nova/auth/fakeldap.py | 173 ++++++++++++++++++++++++++++---------------------- 1 file changed, 98 insertions(+), 75 deletions(-) (limited to 'nova') diff --git a/nova/auth/fakeldap.py b/nova/auth/fakeldap.py index 0e95972f2..eca41b1d3 100644 --- a/nova/auth/fakeldap.py +++ b/nova/auth/fakeldap.py @@ -18,7 +18,11 @@ # License for the specific language governing permissions and limitations # under the License. """ - Fake LDAP server for test harnesses. +Fake LDAP server for test harnesses. + +This class does very little error checking, and knows nothing about ldap +class definitions. It implements the minimum emulation of the python ldap +library to work with nova. """ import json @@ -41,57 +45,39 @@ def initialize(uri): class FakeLDAP(object): def simple_bind_s(self, dn, password): - """This method is ignored, but provided for compatibility""" + """This method is ignored, but provided for compatibility.""" pass def unbind_s(self): - """This method is ignored, but provided for compatibility""" + """This method is ignored, but provided for compatibility.""" pass - def _paren_groups(self, source): - count = 0 - start = 0 - result = [] - for pos in xrange(len(source)): - if source[pos] == '(': - if count == 0: - start = pos - count += 1 - if source[pos] == ')': - count -= 1 - if count == 0: - result.append(source[start:pos+1]) - return result + def add_s(self, dn, attr): + """Add an object with the specified attributes at dn.""" + key = self._redis_prefix + dn - def _match_query(self, query, attrs): - inner = query[1:-1] - if inner.startswith('&'): - l, r = self._paren_groups(inner[1:]) - return self._match_query(l, attrs) and self._match_query(r, attrs) - if inner.startswith('|'): - l, r = self._paren_groups(inner[1:]) - return self._match_query(l, attrs) or self._match_query(r, attrs) - if inner.startswith('!'): - return not self._match_query(query[2:-1], attrs) + value_dict = dict([(k, self.__to_json(v)) for k, v in attr]) + datastore.Redis.instance().hmset(key, value_dict) - (k, sep, v) = inner.partition('=') - return self._match(k, v, attrs) + def delete_s(self, dn): + """Remove the ldap object at specified dn.""" + datastore.Redis.instance().delete(self._redis_prefix + dn) - def _subs(self, v): - subs = { - 'groupOfNames': ['novaProject'] - } - if v in subs: - return [v] + subs[v] - return [v] - - def _match(self, k, v, attrs): - if attrs.has_key(k): - for v in self._subs(v): - if v in attrs[k]: - return True - return False + def modify_s(self, dn, attrs): + """Modify the object at dn using the attribute list. + attr is a list of tuples in the following form: + ([MOD_ADD | MOD_DELETE], attribute, value) + """ + redis = datastore.Redis.instance() + key = self._redis_prefix + dn + for cmd, k, v in attrs: + values = self.__from_json(redis.hget(key, k)) + if cmd == MOD_ADD: + values.append(v) + else: + values.remove(v) + values = redis.hset(key, k, self.__to_json(values)) def search_s(self, dn, scope, query=None, fields=None): """search for all matching objects under dn using the query @@ -106,10 +92,10 @@ class FakeLDAP(object): # get the attributes from redis attrs = redis.hgetall(key) # turn the values from redis into lists - attrs = dict([(k, self._from_json(v)) + attrs = dict([(k, self.__from_json(v)) for k, v in attrs.iteritems()]) # filter the objects by query - if not query or self._match_query(query, attrs): + if not query or self.__match_query(query, attrs): # filter the attributes by fields attrs = dict([(k, v) for k, v in attrs.iteritems() if not fields or k in fields]) @@ -118,44 +104,81 @@ class FakeLDAP(object): raise NO_SUCH_OBJECT() return objects + def __match_query(self, query, attrs): + """Match an ldap query to an attribute dictionary. + &, |, and ! are supported + No syntax checking is performed, so malformed querys will + not work correctly. + """ + # cut off the parentheses + inner = query[1:-1] + if inner.startswith('&'): + # cut off the & + l, r = self.__paren_groups(inner[1:]) + return self.__match_query(l, attrs) and self.__match_query(r, attrs) + if inner.startswith('|'): + # cut off the | + l, r = self.__paren_groups(inner[1:]) + return self.__match_query(l, attrs) or self.__match_query(r, attrs) + if inner.startswith('!'): + # cut off the ! and the nested parentheses + return not self.__match_query(query[2:-1], attrs) + + (k, sep, v) = inner.partition('=') + return self.__match(k, v, attrs) + + def __paren_groups(self, source): + """Split a string into parenthesized groups.""" + count = 0 + start = 0 + result = [] + for pos in xrange(len(source)): + if source[pos] == '(': + if count == 0: + start = pos + count += 1 + if source[pos] == ')': + count -= 1 + if count == 0: + result.append(source[start:pos+1]) + return result + + def __match(self, k, v, attrs): + """Match a given key and value against an attribute list.""" + if k not in attrs: + return False + if k != "objectclass": + return v in attrs[k] + # it is an objectclass check, so check subclasses + values = self.__subs(v) + for value in values: + if value in attrs[k]: + return True + return False + + def __subs(self, value): + """Returns a list of strings representing the ldap objectclass plus + any subclasses that inherit from it. + Fakeldap doesn't know about the ldap object structure, so subclasses + need to be defined manually in the dictionary below + """ + subs = { + 'groupOfNames': ['novaProject'] + } + if value in subs: + return [value] + subs[value] + return [value] + @property def _redis_prefix(self): return 'ldap:' - def _from_json(self, encoded): + def __from_json(self, encoded): """Convert attribute values from json representation.""" # return as simple strings instead of unicode strings return [str(x) for x in json.loads(encoded)] - def _to_json(self, unencoded): + def __to_json(self, unencoded): """Convert attribute values into json representation.""" # all values are returned as lists from ldap return json.dumps(list(unencoded)) - - def add_s(self, dn, attr): - """Add an object with the specified attributes at dn.""" - key = self._redis_prefix + dn - - value_dict = dict([(k, self._to_json(v)) for k, v in attr]) - datastore.Redis.instance().hmset(key, value_dict) - - def delete_s(self, dn): - """Remove the ldap object at specified dn.""" - datastore.Redis.instance().delete(self._redis_prefix + dn) - - def modify_s(self, dn, attrs): - """Modify the object at dn using the attribute list. - attr is a list of tuples in the following form: - ([MOD_ADD | MOD_DELETE], attribute, value) - """ - redis = datastore.Redis.instance() - key = self._redis_prefix + dn - - for cmd, k, v in attrs: - values = self._from_json(redis.hget(key, k)) - if cmd == MOD_ADD: - values.append(v) - else: - values.remove(v) - values = redis.hset(key, k, self._to_json(values)) - -- cgit From daada4adb23e65ddf69ede0f52827d4d80312d3a Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Mon, 28 Jun 2010 14:00:56 -0700 Subject: fix of fakeldap imports and exceptions --- nova/auth/users.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'nova') diff --git a/nova/auth/users.py b/nova/auth/users.py index 64457d3c0..7059be877 100644 --- a/nova/auth/users.py +++ b/nova/auth/users.py @@ -502,12 +502,13 @@ class LDAPWrapper(object): def connect(self): """ connect to ldap as admin user """ - global ldap if FLAGS.fake_users: - import fakeldap as ldap + self.NO_SUCH_OBJECT = fakeldap.NO_SUCH_OBJECT + self.OBJECT_CLASS_VIOLATION = fakeldap.OBJECT_CLASS_VIOLATION self.conn = fakeldap.initialize(FLAGS.ldap_url) else: - assert(ldap.__name__ != 'fakeldap') + self.NO_SUCH_OBJECT = ldap.NO_SUCH_OBJECT + self.OBJECT_CLASS_VIOLATION = ldap.OBJECT_CLASS_VIOLATION self.conn = ldap.initialize(FLAGS.ldap_url) self.conn.simple_bind_s(self.user, self.passwd) @@ -520,7 +521,7 @@ class LDAPWrapper(object): def find_dns(self, dn, query=None): try: res = self.conn.search_s(dn, ldap.SCOPE_SUBTREE, query) - except ldap.NO_SUCH_OBJECT: + except self.NO_SUCH_OBJECT: return [] # just return the DNs return [dn for dn, attributes in res] @@ -528,7 +529,7 @@ class LDAPWrapper(object): def find_objects(self, dn, query = None): try: res = self.conn.search_s(dn, ldap.SCOPE_SUBTREE, query) - except ldap.NO_SUCH_OBJECT: + except self.NO_SUCH_OBJECT: return [] # just return the attributes return [attributes for dn, attributes in res] @@ -732,7 +733,7 @@ class LDAPWrapper(object): attr = [(ldap.MOD_DELETE, 'member', self.__uid_to_dn(uid))] try: self.conn.modify_s(group_dn, attr) - except ldap.OBJECT_CLASS_VIOLATION: + except self.OBJECT_CLASS_VIOLATION: logging.debug("Attempted to remove the last member of a group. " "Deleting the group at %s instead." % group_dn ) self.delete_group(group_dn) -- cgit From 8d42324bf9a3d8ddde5942503892051721f061b6 Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Mon, 28 Jun 2010 14:08:24 -0700 Subject: remove silly default from generate cert --- nova/crypto.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nova') diff --git a/nova/crypto.py b/nova/crypto.py index 80b4ef9de..413796ccc 100644 --- a/nova/crypto.py +++ b/nova/crypto.py @@ -96,7 +96,7 @@ def ssl_pub_to_ssh_pub(ssl_public_key, name='root', suffix='nova'): return '%s %s@%s\n' %(out.strip(), name, suffix) -def generate_x509_cert(subject="/C=US/ST=California/L=The Mission/O=CloudFed/OU=NOVA/CN=foo", bits=1024): +def generate_x509_cert(subject, bits=1024): tmpdir = tempfile.mkdtemp() keyfile = os.path.abspath(os.path.join(tmpdir, 'temp.key')) csrfile = os.path.join(tmpdir, 'temp.csr') -- cgit From 11a818b6dd71593b63fc922d898d802bd0538e4b Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Mon, 28 Jun 2010 14:09:01 -0700 Subject: remove spaces from default cert --- nova/auth/users.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nova') diff --git a/nova/auth/users.py b/nova/auth/users.py index 7059be877..4bb295dc2 100644 --- a/nova/auth/users.py +++ b/nova/auth/users.py @@ -483,7 +483,7 @@ class UserManager(object): def __cert_subject(self, uid): # FIXME(ja) - this should be pulled from a global configuration - return "/C=US/ST=California/L=Mountain View/O=Anso Labs/OU=Nova Dev/CN=%s-%s" % (uid, str(datetime.datetime.utcnow().isoformat())) + return "/C=US/ST=California/L=MountainView/O=AnsoLabs/OU=NovaDev/CN=%s-%s" % (uid, str(datetime.datetime.utcnow().isoformat())) class LDAPWrapper(object): -- cgit From e6f3a97bb4ae2729c2c6e9b9f4129a30dd84cc9b Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Mon, 28 Jun 2010 14:09:54 -0700 Subject: add object class violation exception to fakeldap --- nova/auth/fakeldap.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'nova') diff --git a/nova/auth/fakeldap.py b/nova/auth/fakeldap.py index eca41b1d3..bb70a686f 100644 --- a/nova/auth/fakeldap.py +++ b/nova/auth/fakeldap.py @@ -37,6 +37,8 @@ MOD_DELETE = 1 class NO_SUCH_OBJECT(Exception): pass +class OBJECT_CLASS_VIOLATION(Exception): + pass def initialize(uri): return FakeLDAP() -- cgit From 72ccc08d22aadd596a413900b6086a6f7d1a044d Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Mon, 28 Jun 2010 15:36:59 -0700 Subject: fix for multiple shelves for each volume node --- nova/tests/storage_unittest.py | 17 ++++++-- nova/volume/storage.py | 98 ++++++++++++++++++++++++------------------ 2 files changed, 70 insertions(+), 45 deletions(-) (limited to 'nova') diff --git a/nova/tests/storage_unittest.py b/nova/tests/storage_unittest.py index 73215c5ca..36fcc6f19 100644 --- a/nova/tests/storage_unittest.py +++ b/nova/tests/storage_unittest.py @@ -38,10 +38,7 @@ class StorageTestCase(test.TrialTestCase): self.mystorage = None self.flags(fake_libvirt=True, fake_storage=True) - if FLAGS.fake_storage: - self.mystorage = storage.FakeBlockStore() - else: - self.mystorage = storage.BlockStore() + self.mystorage = storage.BlockStore() def test_run_create_volume(self): vol_size = '0' @@ -65,6 +62,18 @@ class StorageTestCase(test.TrialTestCase): self.mystorage.create_volume, vol_size, user_id, project_id) + def test_too_many_volumes(self): + vol_size = '1' + user_id = 'fake' + project_id = 'fake' + num_shelves = FLAGS.last_shelf_id - FLAGS.first_shelf_id + 1 + total_slots = FLAGS.slots_per_shelf * num_shelves + for i in xrange(total_slots): + self.mystorage.create_volume(vol_size, user_id, project_id) + self.assertRaises(storage.NoMoreVolumes, + self.mystorage.create_volume, + vol_size, user_id, project_id) + def test_run_attach_detach_volume(self): # Create one volume and one node to test with instance_id = "storage-test" diff --git a/nova/volume/storage.py b/nova/volume/storage.py index 9c58358bd..fa1cdfaec 100644 --- a/nova/volume/storage.py +++ b/nova/volume/storage.py @@ -26,9 +26,10 @@ Currently uses Ata-over-Ethernet. import glob import logging -import random +import os import socket -import subprocess +import shutil +import tempfile import time from nova import vendor @@ -38,7 +39,6 @@ from twisted.internet import defer from nova import datastore from nova import exception from nova import flags -from nova import rpc from nova import utils from nova import validate @@ -53,15 +53,24 @@ flags.DEFINE_string('aoe_eth_dev', 'eth0', flags.DEFINE_string('storage_name', socket.gethostname(), 'name of this node') -flags.DEFINE_integer('shelf_id', - utils.last_octet(utils.get_my_ip()), - 'AoE shelf_id for this node') +flags.DEFINE_integer('first_shelf_id', + utils.last_octet(utils.get_my_ip()) * 10, + 'AoE starting shelf_id for this node') +flags.DEFINE_integer('last_shelf_id', + utils.last_octet(utils.get_my_ip()) * 10 + 9, + 'AoE starting shelf_id for this node') +flags.DEFINE_integer('slots_per_shelf', + 16, + 'Number of AoE slots per shelf') flags.DEFINE_string('storage_availability_zone', 'nova', 'availability zone of this node') flags.DEFINE_boolean('fake_storage', False, 'Should we make real storage volumes to attach?') +class NoMoreVolumes(exception.Error): + pass + # TODO(joshua) Index of volumes by project def get_volume(volume_id): @@ -82,10 +91,16 @@ class BlockStore(object): def __init__(self): super(BlockStore, self).__init__() self.volume_class = Volume + self.export_dir = "/var/lib/vblade-persist/vblades" if FLAGS.fake_storage: + self.export_dir = tempfile.mkdtemp() self.volume_class = FakeVolume self._init_volume_group() + def __del__(self): + if FLAGS.fake_storage: + shutil.rmtree(self.export_dir) + def report_state(self): #TODO: aggregate the state of the system pass @@ -98,7 +113,10 @@ class BlockStore(object): Volume at this point has size, owner, and zone. """ logging.debug("Creating volume of size: %s" % (size)) - vol = self.volume_class.create(size, user_id, project_id) + vol = self.volume_class.create(size, + user_id, + project_id, + self.export_dir) datastore.Redis.instance().sadd('volumes', vol['volume_id']) datastore.Redis.instance().sadd('volumes:%s' % (FLAGS.storage_name), vol['volume_id']) self._restart_exports() @@ -139,29 +157,20 @@ class BlockStore(object): utils.runthis("PVCreate returned: %s", "sudo pvcreate %s" % (FLAGS.storage_dev)) utils.runthis("VGCreate returned: %s", "sudo vgcreate %s %s" % (FLAGS.volume_group, FLAGS.storage_dev)) - -class FakeBlockStore(BlockStore): - def __init__(self): - super(FakeBlockStore, self).__init__() - - def _init_volume_group(self): - pass - - def _restart_exports(self): - pass - - class Volume(datastore.RedisModel): object_type = 'volume' - def __init__(self, volume_id=None): + def __init__(self, + volume_id=None, + export_dir="/var/lib/vblade-persist/vblades"): + self.export_dir = export_dir super(Volume, self).__init__(object_id=volume_id) @classmethod - def create(cls, size, user_id, project_id): + def create(cls, size, user_id, project_id, export_dir=None): volume_id = utils.generate_uid('vol') - vol = cls(volume_id=volume_id) + vol = cls(volume_id=volume_id, export_dir=export_dir) vol['volume_id'] = volume_id vol['node_name'] = FLAGS.storage_name vol['size'] = size @@ -177,7 +186,7 @@ class Volume(datastore.RedisModel): vol['delete_on_termination'] = 'False' vol.save() vol.create_lv() - vol.setup_export() + vol._setup_export() # TODO(joshua) - We need to trigger a fanout message for aoe-discover on all the nodes # TODO(joshua vol['status'] = "available" @@ -229,15 +238,21 @@ class Volume(datastore.RedisModel): def _delete_lv(self): utils.runthis("Removing LV: %s", "sudo lvremove -f %s/%s" % (FLAGS.volume_group, self['volume_id'])) - def setup_export(self): - (shelf_id, blade_id) = get_next_aoe_numbers() + def _setup_export(self): + (shelf_id, blade_id ) = get_next_aoe_numbers(self.export_dir) self['aoe_device'] = "e%s.%s" % (shelf_id, blade_id) self['shelf_id'] = shelf_id self['blade_id'] = blade_id self.save() + self._exec_export() + + def _exec_export(self): utils.runthis("Creating AOE export: %s", - "sudo vblade-persist setup %s %s %s /dev/%s/%s" % - (shelf_id, blade_id, FLAGS.aoe_eth_dev, FLAGS.volume_group, self['volume_id'])) + "sudo vblade- persist setup %s %s %s /dev/%s/%s" % + (self['shelf_id'], + self['blade_id'], + FLAGS.aoe_eth_dev, + FLAGS.volume_group, self['volume_id'])) def _remove_export(self): utils.runthis("Stopped AOE export: %s", "sudo vblade-persist stop %s %s" % (self['shelf_id'], self['blade_id'])) @@ -248,13 +263,10 @@ class FakeVolume(Volume): def create_lv(self): pass - def setup_export(self): - # TODO(???): This may not be good enough? - blade_id = ''.join([random.choice('0123456789') for x in xrange(3)]) - self['shelf_id'] = FLAGS.shelf_id - self['blade_id'] = blade_id - self['aoe_device'] = "e%s.%s" % (FLAGS.shelf_id, blade_id) - self.save() + def _exec_export(self): + fname = os.path.join(self.export_dir, self['aoe_device']) + with file(fname, "w"): + pass def _remove_export(self): pass @@ -262,10 +274,14 @@ class FakeVolume(Volume): def _delete_lv(self): pass -def get_next_aoe_numbers(): - aoes = glob.glob("/var/lib/vblade-persist/vblades/e*") - aoes.extend(['e0.0']) - blade_id = int(max([int(a.split('.')[1]) for a in aoes])) + 1 - logging.debug("Next blade_id is %s" % (blade_id)) - shelf_id = FLAGS.shelf_id - return (shelf_id, blade_id) +def get_next_aoe_numbers(dir): + for shelf_id in xrange(FLAGS.first_shelf_id, FLAGS.last_shelf_id + 1): + aoes = glob.glob("%s/e%s.*" % (dir, shelf_id)) + if not aoes: + blade_id = 0 + else: + blade_id = int(max([int(a.rpartition('.')[2]) for a in aoes])) + 1 + if blade_id < FLAGS.slots_per_shelf: + print("Next shelf.blade is %s.%s" % (shelf_id, blade_id)) + return (shelf_id, blade_id) + raise NoMoreVolumes() -- cgit From 286c0a6b7ae5d28792ed4e3377ecfb8f9e66aa5b Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Mon, 28 Jun 2010 16:01:09 -0700 Subject: simplified handling of tempdir for Fakes --- nova/volume/storage.py | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) (limited to 'nova') diff --git a/nova/volume/storage.py b/nova/volume/storage.py index fa1cdfaec..594881a24 100644 --- a/nova/volume/storage.py +++ b/nova/volume/storage.py @@ -59,6 +59,9 @@ flags.DEFINE_integer('first_shelf_id', flags.DEFINE_integer('last_shelf_id', utils.last_octet(utils.get_my_ip()) * 10 + 9, 'AoE starting shelf_id for this node') +flags.DEFINE_string('aoe_export_dir', + '/var/lib/vblade-persist/vblades', + 'AoE directory where exports are created') flags.DEFINE_integer('slots_per_shelf', 16, 'Number of AoE slots per shelf') @@ -91,15 +94,14 @@ class BlockStore(object): def __init__(self): super(BlockStore, self).__init__() self.volume_class = Volume - self.export_dir = "/var/lib/vblade-persist/vblades" if FLAGS.fake_storage: - self.export_dir = tempfile.mkdtemp() + FLAGS.aoe_export_dir = tempfile.mkdtemp() self.volume_class = FakeVolume self._init_volume_group() def __del__(self): if FLAGS.fake_storage: - shutil.rmtree(self.export_dir) + shutil.rmtree(FLAGS.aoe_export_dir) def report_state(self): #TODO: aggregate the state of the system @@ -113,10 +115,7 @@ class BlockStore(object): Volume at this point has size, owner, and zone. """ logging.debug("Creating volume of size: %s" % (size)) - vol = self.volume_class.create(size, - user_id, - project_id, - self.export_dir) + vol = self.volume_class.create(size, user_id, project_id) datastore.Redis.instance().sadd('volumes', vol['volume_id']) datastore.Redis.instance().sadd('volumes:%s' % (FLAGS.storage_name), vol['volume_id']) self._restart_exports() @@ -161,16 +160,13 @@ class Volume(datastore.RedisModel): object_type = 'volume' - def __init__(self, - volume_id=None, - export_dir="/var/lib/vblade-persist/vblades"): - self.export_dir = export_dir + def __init__(self, volume_id=None): super(Volume, self).__init__(object_id=volume_id) @classmethod - def create(cls, size, user_id, project_id, export_dir=None): + def create(cls, size, user_id, project_id): volume_id = utils.generate_uid('vol') - vol = cls(volume_id=volume_id, export_dir=export_dir) + vol = cls(volume_id=volume_id) vol['volume_id'] = volume_id vol['node_name'] = FLAGS.storage_name vol['size'] = size @@ -239,7 +235,7 @@ class Volume(datastore.RedisModel): utils.runthis("Removing LV: %s", "sudo lvremove -f %s/%s" % (FLAGS.volume_group, self['volume_id'])) def _setup_export(self): - (shelf_id, blade_id ) = get_next_aoe_numbers(self.export_dir) + (shelf_id, blade_id ) = get_next_aoe_numbers() self['aoe_device'] = "e%s.%s" % (shelf_id, blade_id) self['shelf_id'] = shelf_id self['blade_id'] = blade_id @@ -264,7 +260,7 @@ class FakeVolume(Volume): pass def _exec_export(self): - fname = os.path.join(self.export_dir, self['aoe_device']) + fname = os.path.join(FLAGS.aoe_export_dir, self['aoe_device']) with file(fname, "w"): pass @@ -274,14 +270,14 @@ class FakeVolume(Volume): def _delete_lv(self): pass -def get_next_aoe_numbers(dir): +def get_next_aoe_numbers(): for shelf_id in xrange(FLAGS.first_shelf_id, FLAGS.last_shelf_id + 1): - aoes = glob.glob("%s/e%s.*" % (dir, shelf_id)) + aoes = glob.glob("%s/e%s.*" % (FLAGS.aoe_export_dir, shelf_id)) if not aoes: blade_id = 0 else: blade_id = int(max([int(a.rpartition('.')[2]) for a in aoes])) + 1 if blade_id < FLAGS.slots_per_shelf: - print("Next shelf.blade is %s.%s" % (shelf_id, blade_id)) + logging.debug("Next shelf.blade is %s.%s" % (shelf_id, blade_id)) return (shelf_id, blade_id) raise NoMoreVolumes() -- cgit From bbaa17c262fc7bcea19b641a9e239e595d76d964 Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Mon, 28 Jun 2010 19:52:06 -0700 Subject: reformatting to fit within 80 characters --- nova/auth/users.py | 159 +++++++++++++++++++++++++++++++++++------------------ 1 file changed, 107 insertions(+), 52 deletions(-) (limited to 'nova') diff --git a/nova/auth/users.py b/nova/auth/users.py index 4bb295dc2..1fc97345f 100644 --- a/nova/auth/users.py +++ b/nova/auth/users.py @@ -52,15 +52,21 @@ from nova import objectstore # for flags FLAGS = flags.FLAGS -flags.DEFINE_string('ldap_url', 'ldap://localhost', 'Point this at your ldap server') +flags.DEFINE_string('ldap_url', 'ldap://localhost', + 'Point this at your ldap server') flags.DEFINE_string('ldap_password', 'changeme', 'LDAP password') -flags.DEFINE_string('user_dn', 'cn=Manager,dc=example,dc=com', 'DN of admin user') +flags.DEFINE_string('user_dn', 'cn=Manager,dc=example,dc=com', + 'DN of admin user') flags.DEFINE_string('user_unit', 'Users', 'OID for Users') -flags.DEFINE_string('user_ldap_subtree', 'ou=Users,dc=example,dc=com', 'OU for Users') -flags.DEFINE_string('project_ldap_subtree', 'ou=Groups,dc=example,dc=com', 'OU for Projects') -flags.DEFINE_string('role_ldap_subtree', 'ou=Groups,dc=example,dc=com', 'OU for Roles') - -# mapping with these flags is necessary because we're going to tie in to an existing ldap schema +flags.DEFINE_string('user_ldap_subtree', 'ou=Users,dc=example,dc=com', + 'OU for Users') +flags.DEFINE_string('project_ldap_subtree', 'ou=Groups,dc=example,dc=com', + 'OU for Projects') +flags.DEFINE_string('role_ldap_subtree', 'ou=Groups,dc=example,dc=com', + 'OU for Roles') + +# NOTE(vish): mapping with these flags is necessary because we're going +# to tie in to an existing ldap schema flags.DEFINE_string('ldap_cloudadmin', 'cn=cloudadmins,ou=Groups,dc=example,dc=com', 'cn for Cloud Admins') flags.DEFINE_string('ldap_itsec', @@ -72,11 +78,15 @@ flags.DEFINE_string('ldap_netadmin', flags.DEFINE_string('ldap_developer', 'cn=developers,ou=Groups,dc=example,dc=com', 'cn for Developers') -# a user with one of these roles will be a superuser and have access to all api commands -flags.DEFINE_list('superuser_roles', ['cloudadmin'], 'roles that ignore rbac checking completely') +# NOTE(vish): a user with one of these roles will be a superuser and +# have access to all api commands +flags.DEFINE_list('superuser_roles', ['cloudadmin'], + 'roles that ignore rbac checking completely') -# a user with one of these roles will have it for every project, even if he or she is not a member of the project -flags.DEFINE_list('global_roles', ['cloudadmin', 'itsec'], 'roles that apply to all projects') +# NOTE(vish): a user with one of these roles will have it for every +# project, even if he or she is not a member of the project +flags.DEFINE_list('global_roles', ['cloudadmin', 'itsec'], + 'roles that apply to all projects') flags.DEFINE_string('credentials_template', utils.abspath('auth/novarc.template'), @@ -90,15 +100,20 @@ flags.DEFINE_string('credential_cert_file', 'cert.pem', 'Filename of certificate in credentials zip') flags.DEFINE_string('credential_rc_file', 'novarc', 'Filename of rc in credentials zip') -flags.DEFINE_string('vpn_ip', '127.0.0.1', 'Public IP for the cloudpipe VPN servers') +flags.DEFINE_string('vpn_ip', '127.0.0.1', + 'Public IP for the cloudpipe VPN servers') class AuthBase(object): @classmethod def safe_id(cls, obj): - """this method will return the id of the object if the object is of this class, otherwise - it will return the original object. This allows methods to accept objects or - ids as paramaters""" + """Safe get object id. + + This method will return the id of the object if the object + is of this class, otherwise it will return the original object. + This allows methods to accept objects or ids as paramaters. + + """ if isinstance(obj, cls): return obj.id else: @@ -195,7 +210,8 @@ class User(AuthBase): return UserManager.instance().get_key_pairs(self.id) def __repr__(self): - return "User('%s', '%s', '%s', '%s', %s)" % (self.id, self.name, self.access, self.secret, self.admin) + return "User('%s', '%s', '%s', '%s', %s)" % ( + self.id, self.name, self.access, self.secret, self.admin) class KeyPair(AuthBase): def __init__(self, id, owner_id, public_key, fingerprint): @@ -209,7 +225,8 @@ class KeyPair(AuthBase): return UserManager.instance().delete_key_pair(self.owner, self.name) def __repr__(self): - return "KeyPair('%s', '%s', '%s', '%s')" % (self.id, self.owner_id, self.public_key, self.fingerprint) + return "KeyPair('%s', '%s', '%s', '%s')" % ( + self.id, self.owner_id, self.public_key, self.fingerprint) class Group(AuthBase): """id and name are currently the same""" @@ -223,7 +240,8 @@ class Group(AuthBase): return User.safe_id(user) in self.member_ids def __repr__(self): - return "Group('%s', '%s', %s)" % (self.id, self.description, self.member_ids) + return "Group('%s', '%s', %s)" % ( + self.id, self.description, self.member_ids) class Project(Group): def __init__(self, id, project_manager_id, description, member_ids): @@ -298,7 +316,9 @@ class Project(Group): return UserManager.instance().generate_x509_cert(user, self) def __repr__(self): - return "Project('%s', '%s', '%s', %s)" % (self.id, self.project_manager_id, self.description, self.member_ids) + return "Project('%s', '%s', '%s', %s)" % ( + self.id, self.project_manager_id, + self.description, self.member_ids) class UserManager(object): def __init__(self): @@ -322,7 +342,9 @@ class UserManager(object): except: pass return cls._instance - def authenticate(self, access, signature, params, verb='GET', server_string='127.0.0.1:8773', path='/', verify_signature=True): + def authenticate(self, access, signature, params, verb='GET', + server_string='127.0.0.1:8773', path='/', + verify_signature=True): # TODO: Check for valid timestamp (access_key, sep, project_name) = access.partition(':') @@ -334,12 +356,16 @@ class UserManager(object): project = self.get_project(project_name) if project == None: - raise exception.NotFound('No project called %s could be found' % project_name) + raise exception.NotFound('No project called %s could be found' % + project_name) if not user.is_admin() and not project.has_member(user): - raise exception.NotFound('User %s is not a member of project %s' % (user.id, project.id)) + raise exception.NotFound('User %s is not a member of project %s' % + (user.id, project.id)) if verify_signature: - # hmac can't handle unicode, so encode ensures that secret isn't unicode - expected_signature = signer.Signer(user.secret.encode()).generate(params, verb, server_string, path) + # NOTE(vish): hmac can't handle unicode, so encode ensures that + # secret isn't unicode + expected_signature = signer.Signer(user.secret.encode()).generate( + params, verb, server_string, path) logging.debug('user.secret: %s', user.secret) logging.debug('expected_signature: %s', expected_signature) logging.debug('signature: %s', signature) @@ -369,17 +395,21 @@ class UserManager(object): def add_role(self, user, role, project=None): with LDAPWrapper() as conn: - return conn.add_role(User.safe_id(user), role, Project.safe_id(project)) + return conn.add_role(User.safe_id(user), role, + Project.safe_id(project)) def remove_role(self, user, role, project=None): with LDAPWrapper() as conn: - return conn.remove_role(User.safe_id(user), role, Project.safe_id(project)) + return conn.remove_role(User.safe_id(user), role, + Project.safe_id(project)) - def create_project(self, name, manager_user, description=None, member_users=None): + def create_project(self, name, manager_user, + description=None, member_users=None): if member_users: member_users = [User.safe_id(u) for u in member_users] with LDAPWrapper() as conn: - return conn.create_project(name, User.safe_id(manager_user), description, member_users) + return conn.create_project(name, User.safe_id(manager_user), + description, member_users) def get_projects(self): with LDAPWrapper() as conn: @@ -392,7 +422,8 @@ class UserManager(object): def add_to_project(self, user, project): with LDAPWrapper() as conn: - return conn.add_to_project(User.safe_id(user), Project.safe_id(project)) + return conn.add_to_project(User.safe_id(user), + Project.safe_id(project)) def is_project_manager(self, user, project): if not isinstance(project, Project): @@ -408,7 +439,8 @@ class UserManager(object): def remove_from_project(self, user, project): with LDAPWrapper() as conn: - return conn.remove_from_project(User.safe_id(user), Project.safe_id(project)) + return conn.remove_from_project(User.safe_id(user), + Project.safe_id(project)) def delete_project(self, project): with LDAPWrapper() as conn: @@ -426,7 +458,8 @@ class UserManager(object): with LDAPWrapper() as conn: return conn.find_users() - def create_user(self, user, access=None, secret=None, admin=False, create_project=True): + def create_user(self, user, access=None, secret=None, + admin=False, create_project=True): if access == None: access = str(uuid.uuid4()) if secret == None: secret = str(uuid.uuid4()) with LDAPWrapper() as conn: @@ -535,19 +568,23 @@ class LDAPWrapper(object): return [attributes for dn, attributes in res] def find_users(self): - attrs = self.find_objects(FLAGS.user_ldap_subtree, '(objectclass=novaUser)') + attrs = self.find_objects(FLAGS.user_ldap_subtree, + '(objectclass=novaUser)') return [self.__to_user(attr) for attr in attrs] def find_key_pairs(self, uid): - attrs = self.find_objects(self.__uid_to_dn(uid), '(objectclass=novaKeyPair)') + attrs = self.find_objects(self.__uid_to_dn(uid), + '(objectclass=novaKeyPair)') return [self.__to_key_pair(uid, attr) for attr in attrs] def find_projects(self): - attrs = self.find_objects(FLAGS.project_ldap_subtree, '(objectclass=novaProject)') + attrs = self.find_objects(FLAGS.project_ldap_subtree, + '(objectclass=novaProject)') return [self.__to_project(attr) for attr in attrs] def find_roles(self, tree): - attrs = self.find_objects(tree, '(&(objectclass=groupOfNames)(!(objectclass=novaProject)))') + attrs = self.find_objects(tree, + '(&(objectclass=groupOfNames)(!(objectclass=novaProject)))') return [self.__to_group(attr) for attr in attrs] def find_group_dns_with_member(self, tree, uid): @@ -557,7 +594,8 @@ class LDAPWrapper(object): return dns def find_user(self, uid): - attr = self.find_object(self.__uid_to_dn(uid), '(objectclass=novaUser)') + attr = self.find_object(self.__uid_to_dn(uid), + '(objectclass=novaUser)') return self.__to_user(attr) def find_key_pair(self, uid, key_name): @@ -614,11 +652,14 @@ class LDAPWrapper(object): self.conn.add_s(self.__uid_to_dn(name), attr) return self.__to_user(dict(attr)) - def create_project(self, name, manager_uid, description=None, member_uids=None): + def create_project(self, name, manager_uid, + description=None, member_uids=None): if self.project_exists(name): - raise exception.Duplicate("Project can't be created because project %s already exists" % name) + raise exception.Duplicate("Project can't be created because " + "project %s already exists" % name) if not self.user_exists(manager_uid): - raise exception.NotFound("Project can't be created because manager %s doesn't exist" % manager_uid) + raise exception.NotFound("Project can't be created because " + "manager %s doesn't exist" % manager_uid) manager_dn = self.__uid_to_dn(manager_uid) # description is a required attribute if description is None: @@ -627,7 +668,8 @@ class LDAPWrapper(object): if member_uids != None: for member_uid in member_uids: if not self.user_exists(member_uid): - raise exception.NotFound("Project can't be created because user %s doesn't exist" % member_uid) + raise exception.NotFound("Project can't be created " + "because user %s doesn't exist" % member_uid) members.append(self.__uid_to_dn(member_uid)) # always add the manager as a member because members is required if not manager_dn in members: @@ -658,16 +700,21 @@ class LDAPWrapper(object): if project_id == None: return FLAGS.__getitem__("ldap_%s" % role).value else: - return 'cn=%s,cn=%s,%s' % (role, project_id, FLAGS.project_ldap_subtree) + return 'cn=%s,cn=%s,%s' % (role, + project_id, + FLAGS.project_ldap_subtree) - def __create_group(self, group_dn, name, uid, description, member_uids = None): + def __create_group(self, group_dn, name, uid, + description, member_uids = None): if self.group_exists(name): - raise exception.Duplicate("Group can't be created because group %s already exists" % name) + raise exception.Duplicate("Group can't be created because " + "group %s already exists" % name) members = [] if member_uids != None: for member_uid in member_uids: if not self.user_exists(member_uid): - raise exception.NotFound("Group can't be created because user %s doesn't exist" % member_uid) + raise exception.NotFound("Group can't be created " + "because user %s doesn't exist" % member_uid) members.append(self.__uid_to_dn(member_uid)) dn = self.__uid_to_dn(uid) if not dn in members: @@ -700,7 +747,8 @@ class LDAPWrapper(object): def is_in_group(self, uid, group_dn): if not self.user_exists(uid): - raise exception.NotFound("User %s can't be searched in group becuase the user doesn't exist" % (uid,)) + raise exception.NotFound("User %s can't be searched in group " + "becuase the user doesn't exist" % (uid,)) if not self.group_exists(group_dn): return False res = self.find_object(group_dn, @@ -709,11 +757,14 @@ class LDAPWrapper(object): def add_to_group(self, uid, group_dn): if not self.user_exists(uid): - raise exception.NotFound("User %s can't be added to the group becuase the user doesn't exist" % (uid,)) + raise exception.NotFound("User %s can't be added to the group " + "becuase the user doesn't exist" % (uid,)) if not self.group_exists(group_dn): - raise exception.NotFound("The group at dn %s doesn't exist" % (group_dn,)) + raise exception.NotFound("The group at dn %s doesn't exist" % + (group_dn,)) if self.is_in_group(uid, group_dn): - raise exception.Duplicate("User %s is already a member of the group %s" % (uid, group_dn)) + raise exception.Duplicate("User %s is already a member of " + "the group %s" % (uid, group_dn)) attr = [ (ldap.MOD_ADD, 'member', self.__uid_to_dn(uid)) ] @@ -721,11 +772,14 @@ class LDAPWrapper(object): def remove_from_group(self, uid, group_dn): if not self.group_exists(group_dn): - raise exception.NotFound("The group at dn %s doesn't exist" % (group_dn,)) + raise exception.NotFound("The group at dn %s doesn't exist" % + (group_dn,)) if not self.user_exists(uid): - raise exception.NotFound("User %s can't be removed from the group because the user doesn't exist" % (uid,)) + raise exception.NotFound("User %s can't be removed from the " + "group because the user doesn't exist" % (uid,)) if not self.is_in_group(uid, group_dn): - raise exception.NotFound("User %s is not a member of the group" % (uid,)) + raise exception.NotFound("User %s is not a member of the group" % + (uid,)) self._safe_remove_from_group(group_dn, uid) def _safe_remove_from_group(self, group_dn, uid): @@ -740,7 +794,8 @@ class LDAPWrapper(object): def remove_from_all(self, uid): if not self.user_exists(uid): - raise exception.NotFound("User %s can't be removed from all because the user doesn't exist" % (uid,)) + raise exception.NotFound("User %s can't be removed from all " + "because the user doesn't exist" % (uid,)) dn = self.__uid_to_dn(uid) role_dns = self.find_group_dns_with_member( FLAGS.role_ldap_subtree, uid) -- cgit From c363f3239168081d5b87f9ef4690a6123784a024 Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Mon, 28 Jun 2010 20:31:06 -0700 Subject: formatting fixes and refactoring from code review --- nova/auth/fakeldap.py | 184 ++++++++++++++++++++++++++++---------------------- 1 file changed, 105 insertions(+), 79 deletions(-) (limited to 'nova') diff --git a/nova/auth/fakeldap.py b/nova/auth/fakeldap.py index bb70a686f..e27ac57bb 100644 --- a/nova/auth/fakeldap.py +++ b/nova/auth/fakeldap.py @@ -29,11 +29,11 @@ import json from nova import datastore + SCOPE_SUBTREE = 2 MOD_ADD = 0 MOD_DELETE = 1 - class NO_SUCH_OBJECT(Exception): pass @@ -43,8 +43,75 @@ class OBJECT_CLASS_VIOLATION(Exception): def initialize(uri): return FakeLDAP() +def _match_query(query, attrs): + """Match an ldap query to an attribute dictionary. + + &, |, and ! are supported in the query. No syntax checking is performed, + so malformed querys will not work correctly. + + """ + # cut off the parentheses + inner = query[1:-1] + if inner.startswith('&'): + # cut off the & + l, r = _paren_groups(inner[1:]) + return _match_query(l, attrs) and _match_query(r, attrs) + if inner.startswith('|'): + # cut off the | + l, r = _paren_groups(inner[1:]) + return _match_query(l, attrs) or _match_query(r, attrs) + if inner.startswith('!'): + # cut off the ! and the nested parentheses + return not _match_query(query[2:-1], attrs) + + (k, sep, v) = inner.partition('=') + return _match(k, v, attrs) + +def _paren_groups(source): + """Split a string into parenthesized groups.""" + count = 0 + start = 0 + result = [] + for pos in xrange(len(source)): + if source[pos] == '(': + if count == 0: + start = pos + count += 1 + if source[pos] == ')': + count -= 1 + if count == 0: + result.append(source[start:pos+1]) + return result + +def _match(k, v, attrs): + """Match a given key and value against an attribute list.""" + if k not in attrs: + return False + if k != "objectclass": + return v in attrs[k] + # it is an objectclass check, so check subclasses + values = _subs(v) + for value in values: + if value in attrs[k]: + return True + return False + +def _subs(value): + """Returns a list of subclass strings. + + The strings represent the ldap objectclass plus any subclasses that + inherit from it. Fakeldap doesn't know about the ldap object structure, + so subclasses need to be defined manually in the dictionary below. + + """ + subs = {'groupOfNames': ['novaProject']} + if value in subs: + return [value] + subs[value] + return [value] class FakeLDAP(object): + #TODO(vish): refactor this class to use a wrapper instead of accessing + # redis directly def simple_bind_s(self, dn, password): """This method is ignored, but provided for compatibility.""" @@ -56,22 +123,26 @@ class FakeLDAP(object): def add_s(self, dn, attr): """Add an object with the specified attributes at dn.""" - key = self._redis_prefix + dn + key = "%s%s" % (self.__redis_prefix, dn) value_dict = dict([(k, self.__to_json(v)) for k, v in attr]) datastore.Redis.instance().hmset(key, value_dict) def delete_s(self, dn): """Remove the ldap object at specified dn.""" - datastore.Redis.instance().delete(self._redis_prefix + dn) + datastore.Redis.instance().delete("%s%s" % (self.__redis_prefix, dn)) def modify_s(self, dn, attrs): """Modify the object at dn using the attribute list. - attr is a list of tuples in the following form: + + Args: + dn -- a dn + attrs -- a list of tuples in the following form: ([MOD_ADD | MOD_DELETE], attribute, value) + """ redis = datastore.Redis.instance() - key = self._redis_prefix + dn + key = "%s%s" % (self.__redis_prefix, dn) for cmd, k, v in attrs: values = self.__from_json(redis.hget(key, k)) @@ -82,13 +153,19 @@ class FakeLDAP(object): values = redis.hset(key, k, self.__to_json(values)) def search_s(self, dn, scope, query=None, fields=None): - """search for all matching objects under dn using the query - only SCOPE_SUBTREE is supported. + """Search for all matching objects under dn using the query. + + Args: + dn -- dn to search under + scope -- only SCOPE_SUBTREE is supported + query -- query to filter objects by + fields -- fields to return. Returns all fields if not specified + """ if scope != SCOPE_SUBTREE: raise NotImplementedError(str(scope)) redis = datastore.Redis.instance() - keys = redis.keys(self._redis_prefix + '*' + dn) + keys = redis.keys("%s*%s" % (self.__redis_prefix, dn)) objects = [] for key in keys: # get the attributes from redis @@ -97,90 +174,39 @@ class FakeLDAP(object): attrs = dict([(k, self.__from_json(v)) for k, v in attrs.iteritems()]) # filter the objects by query - if not query or self.__match_query(query, attrs): + if not query or _match_query(query, attrs): # filter the attributes by fields attrs = dict([(k, v) for k, v in attrs.iteritems() if not fields or k in fields]) - objects.append((key[len(self._redis_prefix):], attrs)) + objects.append((key[len(self.__redis_prefix):], attrs)) if objects == []: raise NO_SUCH_OBJECT() return objects - def __match_query(self, query, attrs): - """Match an ldap query to an attribute dictionary. - &, |, and ! are supported - No syntax checking is performed, so malformed querys will - not work correctly. - """ - # cut off the parentheses - inner = query[1:-1] - if inner.startswith('&'): - # cut off the & - l, r = self.__paren_groups(inner[1:]) - return self.__match_query(l, attrs) and self.__match_query(r, attrs) - if inner.startswith('|'): - # cut off the | - l, r = self.__paren_groups(inner[1:]) - return self.__match_query(l, attrs) or self.__match_query(r, attrs) - if inner.startswith('!'): - # cut off the ! and the nested parentheses - return not self.__match_query(query[2:-1], attrs) - - (k, sep, v) = inner.partition('=') - return self.__match(k, v, attrs) - - def __paren_groups(self, source): - """Split a string into parenthesized groups.""" - count = 0 - start = 0 - result = [] - for pos in xrange(len(source)): - if source[pos] == '(': - if count == 0: - start = pos - count += 1 - if source[pos] == ')': - count -= 1 - if count == 0: - result.append(source[start:pos+1]) - return result - - def __match(self, k, v, attrs): - """Match a given key and value against an attribute list.""" - if k not in attrs: - return False - if k != "objectclass": - return v in attrs[k] - # it is an objectclass check, so check subclasses - values = self.__subs(v) - for value in values: - if value in attrs[k]: - return True - return False - - def __subs(self, value): - """Returns a list of strings representing the ldap objectclass plus - any subclasses that inherit from it. - Fakeldap doesn't know about the ldap object structure, so subclasses - need to be defined manually in the dictionary below - """ - subs = { - 'groupOfNames': ['novaProject'] - } - if value in subs: - return [value] + subs[value] - return [value] @property - def _redis_prefix(self): + def __redis_prefix(self): return 'ldap:' def __from_json(self, encoded): - """Convert attribute values from json representation.""" - # return as simple strings instead of unicode strings + """Convert attribute values from json representation. + + Args: + encoded -- a json encoded string + + Returns a list of strings + + """ return [str(x) for x in json.loads(encoded)] def __to_json(self, unencoded): - """Convert attribute values into json representation.""" - # all values are returned as lists from ldap + """Convert attribute values into json representation. + + Args: + unencoded -- an unencoded string or list of strings. If it + is a single string, it will be converted into a list. + + Returns a json string + + """ return json.dumps(list(unencoded)) -- cgit From 6d612730c5e57d495dc281326c0169e8116ecd86 Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Tue, 29 Jun 2010 08:46:10 -0700 Subject: code review reformat --- nova/volume/storage.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'nova') diff --git a/nova/volume/storage.py b/nova/volume/storage.py index 594881a24..a0c4b0d55 100644 --- a/nova/volume/storage.py +++ b/nova/volume/storage.py @@ -71,11 +71,10 @@ flags.DEFINE_string('storage_availability_zone', flags.DEFINE_boolean('fake_storage', False, 'Should we make real storage volumes to attach?') + class NoMoreVolumes(exception.Error): pass -# TODO(joshua) Index of volumes by project - def get_volume(volume_id): """ Returns a redis-backed volume object """ volume_class = Volume @@ -157,7 +156,7 @@ class BlockStore(object): utils.runthis("VGCreate returned: %s", "sudo vgcreate %s %s" % (FLAGS.volume_group, FLAGS.storage_dev)) class Volume(datastore.RedisModel): - + # TODO(joshua) Index of volumes by project object_type = 'volume' def __init__(self, volume_id=None): @@ -235,7 +234,7 @@ class Volume(datastore.RedisModel): utils.runthis("Removing LV: %s", "sudo lvremove -f %s/%s" % (FLAGS.volume_group, self['volume_id'])) def _setup_export(self): - (shelf_id, blade_id ) = get_next_aoe_numbers() + (shelf_id, blade_id) = get_next_aoe_numbers() self['aoe_device'] = "e%s.%s" % (shelf_id, blade_id) self['shelf_id'] = shelf_id self['blade_id'] = blade_id @@ -248,7 +247,8 @@ class Volume(datastore.RedisModel): (self['shelf_id'], self['blade_id'], FLAGS.aoe_eth_dev, - FLAGS.volume_group, self['volume_id'])) + FLAGS.volume_group, + self['volume_id'])) def _remove_export(self): utils.runthis("Stopped AOE export: %s", "sudo vblade-persist stop %s %s" % (self['shelf_id'], self['blade_id'])) @@ -261,8 +261,8 @@ class FakeVolume(Volume): def _exec_export(self): fname = os.path.join(FLAGS.aoe_export_dir, self['aoe_device']) - with file(fname, "w"): - pass + f = file(fname, "w") + f.close() def _remove_export(self): pass @@ -278,6 +278,6 @@ def get_next_aoe_numbers(): else: blade_id = int(max([int(a.rpartition('.')[2]) for a in aoes])) + 1 if blade_id < FLAGS.slots_per_shelf: - logging.debug("Next shelf.blade is %s.%s" % (shelf_id, blade_id)) + logging.debug("Next shelf.blade is %s.%s", shelf_id, blade_id) return (shelf_id, blade_id) raise NoMoreVolumes() -- cgit From 3a90ce226f886b8ec5c002cf0e6803857e45a07b Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Tue, 29 Jun 2010 08:55:27 -0700 Subject: review reformat --- nova/auth/fakeldap.py | 62 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 37 insertions(+), 25 deletions(-) (limited to 'nova') diff --git a/nova/auth/fakeldap.py b/nova/auth/fakeldap.py index e27ac57bb..116fcbb78 100644 --- a/nova/auth/fakeldap.py +++ b/nova/auth/fakeldap.py @@ -34,15 +34,19 @@ SCOPE_SUBTREE = 2 MOD_ADD = 0 MOD_DELETE = 1 + class NO_SUCH_OBJECT(Exception): pass + class OBJECT_CLASS_VIOLATION(Exception): pass + def initialize(uri): return FakeLDAP() + def _match_query(query, attrs): """Match an ldap query to an attribute dictionary. @@ -67,6 +71,7 @@ def _match_query(query, attrs): (k, sep, v) = inner.partition('=') return _match(k, v, attrs) + def _paren_groups(source): """Split a string into parenthesized groups.""" count = 0 @@ -83,6 +88,7 @@ def _paren_groups(source): result.append(source[start:pos+1]) return result + def _match(k, v, attrs): """Match a given key and value against an attribute list.""" if k not in attrs: @@ -96,6 +102,7 @@ def _match(k, v, attrs): return True return False + def _subs(value): """Returns a list of subclass strings. @@ -109,6 +116,32 @@ def _subs(value): return [value] + subs[value] return [value] + +def _from_json(encoded): + """Convert attribute values from json representation. + + Args: + encoded -- a json encoded string + + Returns a list of strings + + """ + return [str(x) for x in json.loads(encoded)] + + +def _to_json(unencoded): + """Convert attribute values into json representation. + + Args: + unencoded -- an unencoded string or list of strings. If it + is a single string, it will be converted into a list. + + Returns a json string + + """ + return json.dumps(list(unencoded)) + + class FakeLDAP(object): #TODO(vish): refactor this class to use a wrapper instead of accessing # redis directly @@ -125,7 +158,7 @@ class FakeLDAP(object): """Add an object with the specified attributes at dn.""" key = "%s%s" % (self.__redis_prefix, dn) - value_dict = dict([(k, self.__to_json(v)) for k, v in attr]) + value_dict = dict([(k, _to_json(v)) for k, v in attr]) datastore.Redis.instance().hmset(key, value_dict) def delete_s(self, dn): @@ -145,12 +178,12 @@ class FakeLDAP(object): key = "%s%s" % (self.__redis_prefix, dn) for cmd, k, v in attrs: - values = self.__from_json(redis.hget(key, k)) + values = _from_json(redis.hget(key, k)) if cmd == MOD_ADD: values.append(v) else: values.remove(v) - values = redis.hset(key, k, self.__to_json(values)) + values = redis.hset(key, k, _to_json(values)) def search_s(self, dn, scope, query=None, fields=None): """Search for all matching objects under dn using the query. @@ -171,7 +204,7 @@ class FakeLDAP(object): # get the attributes from redis attrs = redis.hgetall(key) # turn the values from redis into lists - attrs = dict([(k, self.__from_json(v)) + attrs = dict([(k, _from_json(v)) for k, v in attrs.iteritems()]) # filter the objects by query if not query or _match_query(query, attrs): @@ -188,25 +221,4 @@ class FakeLDAP(object): def __redis_prefix(self): return 'ldap:' - def __from_json(self, encoded): - """Convert attribute values from json representation. - - Args: - encoded -- a json encoded string - - Returns a list of strings - """ - return [str(x) for x in json.loads(encoded)] - - def __to_json(self, unencoded): - """Convert attribute values into json representation. - - Args: - unencoded -- an unencoded string or list of strings. If it - is a single string, it will be converted into a list. - - Returns a json string - - """ - return json.dumps(list(unencoded)) -- cgit From 5a1f5839b8850e32dbdd2a74f6176f37a3e36254 Mon Sep 17 00:00:00 2001 From: Devin Carlen Date: Tue, 29 Jun 2010 21:25:39 -0500 Subject: Updated licenses --- nova/__init__.py | 30 ++++++++++++++++++------------ nova/adminclient.py | 25 +++++++++++++++---------- nova/auth/__init__.py | 31 ++++++++++++++++++------------- nova/auth/fakeldap.py | 24 ++++++++++++++---------- nova/auth/novarc.template | 24 +++++++++++++++--------- nova/auth/rbac.py | 20 ++++++++++++++++++++ nova/auth/signer.py | 32 +++++++++++++++++++------------- nova/auth/slap.sh | 25 +++++++++++++++---------- nova/auth/users.py | 23 ++++++++++++++--------- nova/cloudpipe/__init__.py | 23 ++++++++++++++--------- nova/cloudpipe/api.py | 24 ++++++++++++++---------- nova/cloudpipe/bootscript.sh | 24 +++++++++++++++--------- nova/cloudpipe/client.ovpn.template | 24 +++++++++++++++--------- nova/cloudpipe/pipelib.py | 24 +++++++++++++++--------- nova/compute/__init__.py | 30 ++++++++++++++++++------------ nova/compute/disk.py | 23 ++++++++++++++--------- nova/compute/exception.py | 30 ++++++++++++++++++------------ nova/compute/fakevirtinstance.xml | 30 +++++++++++++++++------------- nova/compute/libvirt.xml.template | 30 +++++++++++++++++------------- nova/compute/linux_net.py | 18 ++++++++++++++++++ nova/compute/model.py | 23 ++++++++++++++--------- nova/compute/monitor.py | 23 ++++++++++++++--------- nova/compute/network.py | 23 ++++++++++++++--------- nova/compute/node.py | 23 ++++++++++++++--------- nova/crypto.py | 23 ++++++++++++++--------- nova/datastore.py | 22 +++++++++++++--------- nova/endpoint/__init__.py | 30 ++++++++++++++++++------------ nova/endpoint/admin.py | 23 ++++++++++++++--------- nova/endpoint/api.py | 24 ++++++++++++++---------- nova/endpoint/cloud.py | 23 ++++++++++++++--------- nova/endpoint/images.py | 23 ++++++++++++++--------- nova/exception.py | 23 ++++++++++++++--------- nova/fakerabbit.py | 23 ++++++++++++++--------- nova/fakevirt.py | 23 ++++++++++++++--------- nova/flags.py | 23 ++++++++++++++--------- nova/objectstore/__init__.py | 30 ++++++++++++++++++------------ nova/objectstore/bucket.py | 23 ++++++++++++++--------- nova/objectstore/handler.py | 26 ++++++++++++++++---------- nova/objectstore/image.py | 23 ++++++++++++++--------- nova/objectstore/stored.py | 30 ++++++++++++++++++------------ nova/process.py | 23 ++++++++++++++--------- nova/rpc.py | 23 ++++++++++++++--------- nova/server.py | 29 +++++++++++++++++------------ nova/test.py | 23 ++++++++++++++--------- nova/tests/__init__.py | 30 ++++++++++++++++++------------ nova/tests/access_unittest.py | 23 ++++++++++++++--------- nova/tests/api_integration.py | 24 +++++++++++++++--------- nova/tests/api_unittest.py | 23 ++++++++++++++--------- nova/tests/cloud_unittest.py | 23 ++++++++++++++--------- nova/tests/datastore_unittest.py | 20 ++++++++++++++++++++ nova/tests/fake_flags.py | 30 ++++++++++++++++++------------ nova/tests/future_unittest.py | 29 +++++++++++++++++------------ nova/tests/keeper_unittest.py | 19 +++++++++++++++++++ nova/tests/network_unittest.py | 23 ++++++++++++++--------- nova/tests/node_unittest.py | 23 ++++++++++++++--------- nova/tests/objectstore_unittest.py | 23 ++++++++++++++--------- nova/tests/process_unittest.py | 23 ++++++++++++++--------- nova/tests/real_flags.py | 30 ++++++++++++++++++------------ nova/tests/storage_unittest.py | 23 ++++++++++++++--------- nova/tests/users_unittest.py | 23 ++++++++++++++--------- nova/tests/validator_unittest.py | 23 ++++++++++++++--------- nova/twistd.py | 29 +++++++++++++++++------------ nova/utils.py | 29 +++++++++++++++++------------ nova/validate.py | 23 ++++++++++++++--------- nova/vendor.py | 29 +++++++++++++++++------------ nova/volume/__init__.py | 30 ++++++++++++++++++------------ nova/volume/storage.py | 23 ++++++++++++++--------- 67 files changed, 1037 insertions(+), 634 deletions(-) (limited to 'nova') diff --git a/nova/__init__.py b/nova/__init__.py index 2b25d1628..1151ee639 100644 --- a/nova/__init__.py +++ b/nova/__init__.py @@ -1,16 +1,22 @@ -# Copyright [2010] [Anso Labs, LLC] -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# +# vim: tabstop=4 shiftwidth=4 softtabstop=4 + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. """ :mod:`nova` -- Cloud IaaS Platform diff --git a/nova/adminclient.py b/nova/adminclient.py index 2cc592b9f..ef1ee03c0 100644 --- a/nova/adminclient.py +++ b/nova/adminclient.py @@ -1,17 +1,22 @@ -# Copyright [2010] [Anso Labs, LLC] +# vim: tabstop=4 shiftwidth=4 softtabstop=4 + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. """ Nova User API client library. """ diff --git a/nova/auth/__init__.py b/nova/auth/__init__.py index 7cd6c618d..bfc5ef4d5 100644 --- a/nova/auth/__init__.py +++ b/nova/auth/__init__.py @@ -1,17 +1,22 @@ -# Copyright [2010] [Anso Labs, LLC] -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# vim: tabstop=4 shiftwidth=4 softtabstop=4 +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. """ :mod:`nova.auth` -- Authentication and Access Control ===================================================== diff --git a/nova/auth/fakeldap.py b/nova/auth/fakeldap.py index feb2ac14a..13b2435dd 100644 --- a/nova/auth/fakeldap.py +++ b/nova/auth/fakeldap.py @@ -1,18 +1,22 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 -# Copyright [2010] [Anso Labs, LLC] + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. """ Fake LDAP server for test harnesses. """ diff --git a/nova/auth/novarc.template b/nova/auth/novarc.template index ee1bc75f2..91a3c68c8 100644 --- a/nova/auth/novarc.template +++ b/nova/auth/novarc.template @@ -1,16 +1,22 @@ -# Copyright [2010] [Anso Labs, LLC] +# vim: tabstop=4 shiftwidth=4 softtabstop=4 + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. NOVA_KEY_DIR=$(pushd $(dirname $BASH_SOURCE)>/dev/null; pwd; popd>/dev/null) export EC2_ACCESS_KEY="%(access)s:%(project)s" diff --git a/nova/auth/rbac.py b/nova/auth/rbac.py index 2283a7cd2..eb85a3de1 100644 --- a/nova/auth/rbac.py +++ b/nova/auth/rbac.py @@ -1,3 +1,23 @@ +# vim: tabstop=4 shiftwidth=4 softtabstop=4 + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + from nova import exception from nova.auth import users diff --git a/nova/auth/signer.py b/nova/auth/signer.py index 4b0169652..526a54262 100644 --- a/nova/auth/signer.py +++ b/nova/auth/signer.py @@ -1,17 +1,23 @@ -# Copyright [2010] [Anso Labs, LLC] -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# vim: tabstop=4 shiftwidth=4 softtabstop=4 +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# # PORTIONS OF THIS FILE ARE FROM: # http://code.google.com/p/boto # Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/ diff --git a/nova/auth/slap.sh b/nova/auth/slap.sh index 44a041d74..ac2af422f 100755 --- a/nova/auth/slap.sh +++ b/nova/auth/slap.sh @@ -1,18 +1,23 @@ #!/usr/bin/env bash -# Copyright [2010] [Anso Labs, LLC] +# vim: tabstop=4 shiftwidth=4 softtabstop=4 + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. # LDAP INSTALL SCRIPT - SHOULD BE IDEMPOTENT, but it SCRUBS all USERS apt-get install -y slapd ldap-utils python-ldap diff --git a/nova/auth/users.py b/nova/auth/users.py index e165c3ff0..72c3c8466 100644 --- a/nova/auth/users.py +++ b/nova/auth/users.py @@ -1,18 +1,23 @@ #!/usr/bin/env python # vim: tabstop=4 shiftwidth=4 softtabstop=4 -# Copyright [2010] [Anso Labs, LLC] + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. """ Nova users and user management, including RBAC hooks. diff --git a/nova/cloudpipe/__init__.py b/nova/cloudpipe/__init__.py index e8ac53976..5c35d696c 100644 --- a/nova/cloudpipe/__init__.py +++ b/nova/cloudpipe/__init__.py @@ -1,17 +1,22 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 -# Copyright [2010] [Anso Labs, LLC] + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. """ :mod:`nova.cloudpipe` -- VPN Server Management diff --git a/nova/cloudpipe/api.py b/nova/cloudpipe/api.py index a8ecbd285..87283ef07 100644 --- a/nova/cloudpipe/api.py +++ b/nova/cloudpipe/api.py @@ -1,18 +1,22 @@ -#!/usr/bin/python # vim: tabstop=4 shiftwidth=4 softtabstop=4 -# Copyright [2010] [Anso Labs, LLC] + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. """ Tornado REST API Request Handlers for CloudPipe diff --git a/nova/cloudpipe/bootscript.sh b/nova/cloudpipe/bootscript.sh index 7adacc067..312258c22 100755 --- a/nova/cloudpipe/bootscript.sh +++ b/nova/cloudpipe/bootscript.sh @@ -1,17 +1,23 @@ #!/bin/bash -# Copyright [2010] [Anso Labs, LLC] +# vim: tabstop=4 shiftwidth=4 softtabstop=4 + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. # This gets zipped and run on the cloudpipe-managed OpenVPN server diff --git a/nova/cloudpipe/client.ovpn.template b/nova/cloudpipe/client.ovpn.template index d6cf8e19c..80b5dab26 100644 --- a/nova/cloudpipe/client.ovpn.template +++ b/nova/cloudpipe/client.ovpn.template @@ -1,16 +1,22 @@ -# Copyright [2010] [Anso Labs, LLC] +# vim: tabstop=4 shiftwidth=4 softtabstop=4 + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. # NOVA user connection # Edit the following lines to point to your cert files: diff --git a/nova/cloudpipe/pipelib.py b/nova/cloudpipe/pipelib.py index adbea6878..106a31368 100644 --- a/nova/cloudpipe/pipelib.py +++ b/nova/cloudpipe/pipelib.py @@ -1,16 +1,22 @@ -# Copyright [2010] [Anso Labs, LLC] +# vim: tabstop=4 shiftwidth=4 softtabstop=4 + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. """ CloudPipe - Build a user-data payload zip file, and launch diff --git a/nova/compute/__init__.py b/nova/compute/__init__.py index e8a6921e7..fe8d357a3 100644 --- a/nova/compute/__init__.py +++ b/nova/compute/__init__.py @@ -1,16 +1,22 @@ -# Copyright [2010] [Anso Labs, LLC] -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# +# vim: tabstop=4 shiftwidth=4 softtabstop=4 + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. """ :mod:`nova.compute` -- Compute Nodes using LibVirt diff --git a/nova/compute/disk.py b/nova/compute/disk.py index acaac89af..84329ae55 100644 --- a/nova/compute/disk.py +++ b/nova/compute/disk.py @@ -1,17 +1,22 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 -# Copyright [2010] [Anso Labs, LLC] + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. """ Utility methods to resize, repartition, and modify disk images. diff --git a/nova/compute/exception.py b/nova/compute/exception.py index 6fe8e381f..829810bb0 100644 --- a/nova/compute/exception.py +++ b/nova/compute/exception.py @@ -1,16 +1,22 @@ -# Copyright [2010] [Anso Labs, LLC] -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# +# vim: tabstop=4 shiftwidth=4 softtabstop=4 + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. """ Exceptions for Compute Node errors, mostly network addressing. diff --git a/nova/compute/fakevirtinstance.xml b/nova/compute/fakevirtinstance.xml index 6036516bb..88cc623a8 100644 --- a/nova/compute/fakevirtinstance.xml +++ b/nova/compute/fakevirtinstance.xml @@ -1,18 +1,22 @@ +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +--> i-A9B8C7D6 12a345bc-67c8-901d-2e34-56f7g89012h3 diff --git a/nova/compute/libvirt.xml.template b/nova/compute/libvirt.xml.template index 4cf6e8b10..9f40365a3 100644 --- a/nova/compute/libvirt.xml.template +++ b/nova/compute/libvirt.xml.template @@ -1,18 +1,22 @@ +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +--> %(name)s diff --git a/nova/compute/linux_net.py b/nova/compute/linux_net.py index b9f775aa3..2ec1fe183 100644 --- a/nova/compute/linux_net.py +++ b/nova/compute/linux_net.py @@ -1,5 +1,23 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + import logging import signal import os diff --git a/nova/compute/model.py b/nova/compute/model.py index 74bf60a3b..cd5ab4047 100644 --- a/nova/compute/model.py +++ b/nova/compute/model.py @@ -1,17 +1,22 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 -# Copyright [2010] [Anso Labs, LLC] + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. """ Datastore Model objects for Compute Instances, with diff --git a/nova/compute/monitor.py b/nova/compute/monitor.py index 4a3b43991..2d6911a89 100644 --- a/nova/compute/monitor.py +++ b/nova/compute/monitor.py @@ -1,17 +1,22 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 -# Copyright [2010] [Anso Labs, LLC] + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. """ Instance Monitoring: diff --git a/nova/compute/network.py b/nova/compute/network.py index acc153677..dc2ff7760 100644 --- a/nova/compute/network.py +++ b/nova/compute/network.py @@ -1,17 +1,22 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 -# Copyright [2010] [Anso Labs, LLC] + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. """ Classes for network control, including VLANs, DHCP, and IP allocation. diff --git a/nova/compute/node.py b/nova/compute/node.py index 3de93d96c..1dd1621b0 100644 --- a/nova/compute/node.py +++ b/nova/compute/node.py @@ -1,17 +1,22 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 -# Copyright [2010] [Anso Labs, LLC] + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. """ Compute Node: diff --git a/nova/crypto.py b/nova/crypto.py index 1f35ffa39..1afe9a025 100644 --- a/nova/crypto.py +++ b/nova/crypto.py @@ -1,17 +1,22 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 -# Copyright [2010] [Anso Labs, LLC] + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. """ Wrappers around standard crypto, including root and intermediate CAs, diff --git a/nova/datastore.py b/nova/datastore.py index ce9a85ef4..82a507468 100644 --- a/nova/datastore.py +++ b/nova/datastore.py @@ -1,18 +1,22 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 -# Copyright [2010] [Anso Labs, LLC] +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Copyright 2010 Anso Labs, LLC # -# http://www.apache.org/licenses/LICENSE-2.0 +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. """ Datastore: diff --git a/nova/endpoint/__init__.py b/nova/endpoint/__init__.py index dbf15d259..4f98051a8 100644 --- a/nova/endpoint/__init__.py +++ b/nova/endpoint/__init__.py @@ -1,16 +1,22 @@ -# Copyright [2010] [Anso Labs, LLC] -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# +# vim: tabstop=4 shiftwidth=4 softtabstop=4 + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. """ :mod:`nova.endpoint` -- Main NOVA Api endpoints diff --git a/nova/endpoint/admin.py b/nova/endpoint/admin.py index b51929a83..d88882039 100644 --- a/nova/endpoint/admin.py +++ b/nova/endpoint/admin.py @@ -1,17 +1,22 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 -# Copyright [2010] [Anso Labs, LLC] + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. """ Admin API controller, exposed through http via the api worker. diff --git a/nova/endpoint/api.py b/nova/endpoint/api.py index 977daff27..8cd10b954 100755 --- a/nova/endpoint/api.py +++ b/nova/endpoint/api.py @@ -1,18 +1,22 @@ -#!/usr/bin/python # vim: tabstop=4 shiftwidth=4 softtabstop=4 -# Copyright [2010] [Anso Labs, LLC] + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. """ Tornado REST API Request Handlers for Nova functions diff --git a/nova/endpoint/cloud.py b/nova/endpoint/cloud.py index afd48aa14..2b4795982 100644 --- a/nova/endpoint/cloud.py +++ b/nova/endpoint/cloud.py @@ -1,17 +1,22 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 -# Copyright [2010] [Anso Labs, LLC] + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. """ Cloud Controller: Implementation of EC2 REST API calls, which are diff --git a/nova/endpoint/images.py b/nova/endpoint/images.py index 673a108e9..ba1c101c3 100644 --- a/nova/endpoint/images.py +++ b/nova/endpoint/images.py @@ -1,17 +1,22 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 -# Copyright [2010] [Anso Labs, LLC] + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. """ Proxy AMI-related calls from the cloud controller, to the running diff --git a/nova/exception.py b/nova/exception.py index 381419101..88fac4471 100644 --- a/nova/exception.py +++ b/nova/exception.py @@ -1,17 +1,22 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 -# Copyright [2010] [Anso Labs, LLC] + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. """ Nova base exception handling, including decorator for re-raising diff --git a/nova/fakerabbit.py b/nova/fakerabbit.py index 13d432b45..b2852bc50 100644 --- a/nova/fakerabbit.py +++ b/nova/fakerabbit.py @@ -1,17 +1,22 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 -# Copyright [2010] [Anso Labs, LLC] + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. """ Based a bit on the carrot.backeds.queue backend... but a lot better """ diff --git a/nova/fakevirt.py b/nova/fakevirt.py index 2b918d388..726df3024 100644 --- a/nova/fakevirt.py +++ b/nova/fakevirt.py @@ -1,17 +1,22 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 -# Copyright [2010] [Anso Labs, LLC] + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. """ A fake (in-memory) hypervisor+api. Allows nova testing w/o KVM and libvirt. diff --git a/nova/flags.py b/nova/flags.py index 84a670e6b..1ed0785fb 100644 --- a/nova/flags.py +++ b/nova/flags.py @@ -1,17 +1,22 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 -# Copyright [2010] [Anso Labs, LLC] + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. """ Package-level global flags are defined here, the rest are defined diff --git a/nova/objectstore/__init__.py b/nova/objectstore/__init__.py index c6c09e53e..b4aa6f928 100644 --- a/nova/objectstore/__init__.py +++ b/nova/objectstore/__init__.py @@ -1,16 +1,22 @@ -# Copyright [2010] [Anso Labs, LLC] -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# +# vim: tabstop=4 shiftwidth=4 softtabstop=4 + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. """ :mod:`nova.objectstore` -- S3-type object store diff --git a/nova/objectstore/bucket.py b/nova/objectstore/bucket.py index 0bf102867..fc8c1a0f3 100644 --- a/nova/objectstore/bucket.py +++ b/nova/objectstore/bucket.py @@ -1,17 +1,22 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 -# Copyright [2010] [Anso Labs, LLC] + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. """ Simple object store using Blobs and JSON files on disk. diff --git a/nova/objectstore/handler.py b/nova/objectstore/handler.py index 97c4eeb36..cb062d146 100644 --- a/nova/objectstore/handler.py +++ b/nova/objectstore/handler.py @@ -1,18 +1,24 @@ -#!/usr/bin/env python +# vim: tabstop=4 shiftwidth=4 softtabstop=4 + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC # # Copyright 2009 Facebook # -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. """ Implementation of an S3-like storage server based on local files. diff --git a/nova/objectstore/image.py b/nova/objectstore/image.py index b8dae4077..9cbe54a1a 100644 --- a/nova/objectstore/image.py +++ b/nova/objectstore/image.py @@ -1,17 +1,22 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 -# Copyright [2010] [Anso Labs, LLC] + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. """ Take uploaded bucket contents and register them as disk images (AMIs). diff --git a/nova/objectstore/stored.py b/nova/objectstore/stored.py index 05a7a1102..4c6ea649b 100644 --- a/nova/objectstore/stored.py +++ b/nova/objectstore/stored.py @@ -1,16 +1,22 @@ -# Copyright [2010] [Anso Labs, LLC] -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# +# vim: tabstop=4 shiftwidth=4 softtabstop=4 + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. """ Properties of an object stored within a bucket. diff --git a/nova/process.py b/nova/process.py index 8e7efd4ee..4792b26e7 100644 --- a/nova/process.py +++ b/nova/process.py @@ -1,17 +1,22 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 -# Copyright [2010] [Anso Labs, LLC] + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. """ Process pool, still buggy right now. diff --git a/nova/rpc.py b/nova/rpc.py index 711aad9fa..c7347156e 100644 --- a/nova/rpc.py +++ b/nova/rpc.py @@ -1,17 +1,22 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 -# Copyright [2010] [Anso Labs, LLC] + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. """ AMQP-based RPC. Queues have consumers and publishers. diff --git a/nova/server.py b/nova/server.py index 227f7fddc..376dbb1da 100644 --- a/nova/server.py +++ b/nova/server.py @@ -1,17 +1,22 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 -# Copyright [2010] [Anso Labs, LLC] -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. """ Base functionality for nova daemons - gradually being replaced with twistd.py. diff --git a/nova/test.py b/nova/test.py index 4b9a9f8a9..4dd3775ef 100644 --- a/nova/test.py +++ b/nova/test.py @@ -1,17 +1,22 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 -# Copyright [2010] [Anso Labs, LLC] + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. """ Base classes for our unit tests. diff --git a/nova/tests/__init__.py b/nova/tests/__init__.py index a4ccbbaeb..3c24deeb3 100644 --- a/nova/tests/__init__.py +++ b/nova/tests/__init__.py @@ -1,16 +1,22 @@ -# Copyright [2010] [Anso Labs, LLC] -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# +# vim: tabstop=4 shiftwidth=4 softtabstop=4 + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. """ :mod:`nova.tests` -- Nova Unittests diff --git a/nova/tests/access_unittest.py b/nova/tests/access_unittest.py index 9eb528555..5b5bc7834 100644 --- a/nova/tests/access_unittest.py +++ b/nova/tests/access_unittest.py @@ -1,17 +1,22 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 -# Copyright [2010] [Anso Labs, LLC] + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import unittest import logging diff --git a/nova/tests/api_integration.py b/nova/tests/api_integration.py index cf84b9907..02aec7120 100644 --- a/nova/tests/api_integration.py +++ b/nova/tests/api_integration.py @@ -1,16 +1,22 @@ -# Copyright [2010] [Anso Labs, LLC] +# vim: tabstop=4 shiftwidth=4 softtabstop=4 + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import unittest diff --git a/nova/tests/api_unittest.py b/nova/tests/api_unittest.py index 29834a840..d6a1d09de 100644 --- a/nova/tests/api_unittest.py +++ b/nova/tests/api_unittest.py @@ -1,17 +1,22 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 -# Copyright [2010] [Anso Labs, LLC] + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import httplib import random diff --git a/nova/tests/cloud_unittest.py b/nova/tests/cloud_unittest.py index 24472451f..0a518de7a 100644 --- a/nova/tests/cloud_unittest.py +++ b/nova/tests/cloud_unittest.py @@ -1,17 +1,22 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 -# Copyright [2010] [Anso Labs, LLC] + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import logging import StringIO diff --git a/nova/tests/datastore_unittest.py b/nova/tests/datastore_unittest.py index 4e4d8586a..78ea56f24 100644 --- a/nova/tests/datastore_unittest.py +++ b/nova/tests/datastore_unittest.py @@ -1,3 +1,23 @@ +# vim: tabstop=4 shiftwidth=4 softtabstop=4 + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + from nova import test from nova import datastore import random diff --git a/nova/tests/fake_flags.py b/nova/tests/fake_flags.py index b7ec73601..5614f6af8 100644 --- a/nova/tests/fake_flags.py +++ b/nova/tests/fake_flags.py @@ -1,16 +1,22 @@ -# Copyright [2010] [Anso Labs, LLC] -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# +# vim: tabstop=4 shiftwidth=4 softtabstop=4 + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. from nova import flags diff --git a/nova/tests/future_unittest.py b/nova/tests/future_unittest.py index 81d69dfff..4a46d8506 100644 --- a/nova/tests/future_unittest.py +++ b/nova/tests/future_unittest.py @@ -1,17 +1,22 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 -# Copyright [2010] [Anso Labs, LLC] -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import logging import StringIO diff --git a/nova/tests/keeper_unittest.py b/nova/tests/keeper_unittest.py index 3896c9e57..f53b1fe56 100644 --- a/nova/tests/keeper_unittest.py +++ b/nova/tests/keeper_unittest.py @@ -1,4 +1,23 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + import random from nova import datastore diff --git a/nova/tests/network_unittest.py b/nova/tests/network_unittest.py index a5d80875d..410fdf7a2 100644 --- a/nova/tests/network_unittest.py +++ b/nova/tests/network_unittest.py @@ -1,17 +1,22 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 -# Copyright [2010] [Anso Labs, LLC] + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import logging import unittest diff --git a/nova/tests/node_unittest.py b/nova/tests/node_unittest.py index 0666730af..91927c35a 100644 --- a/nova/tests/node_unittest.py +++ b/nova/tests/node_unittest.py @@ -1,17 +1,22 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 -# Copyright [2010] [Anso Labs, LLC] + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import logging import time diff --git a/nova/tests/objectstore_unittest.py b/nova/tests/objectstore_unittest.py index 812f5418b..1f468dcfe 100644 --- a/nova/tests/objectstore_unittest.py +++ b/nova/tests/objectstore_unittest.py @@ -1,17 +1,22 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 -# Copyright [2010] [Anso Labs, LLC] + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import glob import hashlib diff --git a/nova/tests/process_unittest.py b/nova/tests/process_unittest.py index 50368dd3f..24fad4d1d 100644 --- a/nova/tests/process_unittest.py +++ b/nova/tests/process_unittest.py @@ -1,17 +1,22 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 -# Copyright [2010] [Anso Labs, LLC] + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import logging from xml.etree import ElementTree diff --git a/nova/tests/real_flags.py b/nova/tests/real_flags.py index 68fe8dc5b..c7ab10d6f 100644 --- a/nova/tests/real_flags.py +++ b/nova/tests/real_flags.py @@ -1,16 +1,22 @@ -# Copyright [2010] [Anso Labs, LLC] -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# +# vim: tabstop=4 shiftwidth=4 softtabstop=4 + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. from nova import flags diff --git a/nova/tests/storage_unittest.py b/nova/tests/storage_unittest.py index d2daccf6f..593ac16f1 100644 --- a/nova/tests/storage_unittest.py +++ b/nova/tests/storage_unittest.py @@ -1,17 +1,22 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 -# Copyright [2010] [Anso Labs, LLC] + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import logging diff --git a/nova/tests/users_unittest.py b/nova/tests/users_unittest.py index 850d59026..d42095f0c 100644 --- a/nova/tests/users_unittest.py +++ b/nova/tests/users_unittest.py @@ -1,17 +1,22 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 -# Copyright [2010] [Anso Labs, LLC] + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import logging import unittest diff --git a/nova/tests/validator_unittest.py b/nova/tests/validator_unittest.py index e605f86cb..032162dff 100644 --- a/nova/tests/validator_unittest.py +++ b/nova/tests/validator_unittest.py @@ -1,17 +1,22 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 -# Copyright [2010] [Anso Labs, LLC] + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. import logging import unittest diff --git a/nova/twistd.py b/nova/twistd.py index ea3c9c168..566b50c56 100644 --- a/nova/twistd.py +++ b/nova/twistd.py @@ -1,17 +1,22 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 -# Copyright [2010] [Anso Labs, LLC] -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. """ Twisted daemon helpers, specifically to parse out gFlags from twisted flags, diff --git a/nova/utils.py b/nova/utils.py index 4acd23101..3339bc940 100644 --- a/nova/utils.py +++ b/nova/utils.py @@ -1,17 +1,22 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 -# Copyright [2010] [Anso Labs, LLC] -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. """ System-level utilities and helper functions. diff --git a/nova/validate.py b/nova/validate.py index adf2d147c..9d89836a1 100644 --- a/nova/validate.py +++ b/nova/validate.py @@ -1,17 +1,22 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 -# Copyright [2010] [Anso Labs, LLC] + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. """ Decorators for argument validation, courtesy of diff --git a/nova/vendor.py b/nova/vendor.py index 758adeb3c..bb17fe129 100644 --- a/nova/vendor.py +++ b/nova/vendor.py @@ -1,17 +1,22 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 -# Copyright [2010] [Anso Labs, LLC] -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. """ Get our vendor folders into the system path. diff --git a/nova/volume/__init__.py b/nova/volume/__init__.py index 1c569f383..82e387a4a 100644 --- a/nova/volume/__init__.py +++ b/nova/volume/__init__.py @@ -1,16 +1,22 @@ -# Copyright [2010] [Anso Labs, LLC] -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# +# vim: tabstop=4 shiftwidth=4 softtabstop=4 + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. """ :mod:`nova.volume` -- Nova Block Storage diff --git a/nova/volume/storage.py b/nova/volume/storage.py index f52252f2d..f2c250e86 100644 --- a/nova/volume/storage.py +++ b/nova/volume/storage.py @@ -1,17 +1,22 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 -# Copyright [2010] [Anso Labs, LLC] + +# Copyright 2010 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2010 Anso Labs, LLC # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. """ Nova Storage manages creating, attaching, detaching, and -- cgit From 10b8e5bdaa8ca601b1e0b0268a6acfec6f5712ad Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Tue, 29 Jun 2010 21:25:59 -0500 Subject: Removed trailing whitespace from header --- nova/__init__.py | 2 +- nova/adminclient.py | 2 +- nova/auth/__init__.py | 2 +- nova/auth/fakeldap.py | 2 +- nova/auth/novarc.template | 2 +- nova/auth/rbac.py | 2 +- nova/auth/signer.py | 2 +- nova/auth/slap.sh | 2 +- nova/auth/users.py | 2 +- nova/cloudpipe/__init__.py | 2 +- nova/cloudpipe/api.py | 2 +- nova/cloudpipe/bootscript.sh | 2 +- nova/cloudpipe/client.ovpn.template | 2 +- nova/cloudpipe/pipelib.py | 2 +- nova/compute/__init__.py | 2 +- nova/compute/disk.py | 2 +- nova/compute/exception.py | 2 +- nova/compute/fakevirtinstance.xml | 2 +- nova/compute/libvirt.xml.template | 2 +- nova/compute/linux_net.py | 2 +- nova/compute/model.py | 2 +- nova/compute/monitor.py | 2 +- nova/compute/network.py | 2 +- nova/compute/node.py | 2 +- nova/crypto.py | 2 +- nova/datastore.py | 2 +- nova/endpoint/__init__.py | 2 +- nova/endpoint/admin.py | 2 +- nova/endpoint/api.py | 2 +- nova/endpoint/cloud.py | 2 +- nova/endpoint/images.py | 2 +- nova/exception.py | 2 +- nova/fakerabbit.py | 2 +- nova/fakevirt.py | 2 +- nova/flags.py | 2 +- nova/objectstore/__init__.py | 2 +- nova/objectstore/bucket.py | 2 +- nova/objectstore/handler.py | 2 +- nova/objectstore/image.py | 2 +- nova/objectstore/stored.py | 2 +- nova/process.py | 2 +- nova/rpc.py | 2 +- nova/server.py | 2 +- nova/test.py | 2 +- nova/tests/__init__.py | 2 +- nova/tests/access_unittest.py | 2 +- nova/tests/api_integration.py | 2 +- nova/tests/api_unittest.py | 2 +- nova/tests/cloud_unittest.py | 2 +- nova/tests/datastore_unittest.py | 2 +- nova/tests/fake_flags.py | 2 +- nova/tests/future_unittest.py | 2 +- nova/tests/keeper_unittest.py | 2 +- nova/tests/network_unittest.py | 2 +- nova/tests/node_unittest.py | 2 +- nova/tests/objectstore_unittest.py | 2 +- nova/tests/process_unittest.py | 2 +- nova/tests/real_flags.py | 2 +- nova/tests/storage_unittest.py | 2 +- nova/tests/users_unittest.py | 2 +- nova/tests/validator_unittest.py | 2 +- nova/twistd.py | 2 +- nova/utils.py | 2 +- nova/validate.py | 2 +- nova/vendor.py | 2 +- nova/volume/__init__.py | 2 +- nova/volume/storage.py | 2 +- 67 files changed, 67 insertions(+), 67 deletions(-) (limited to 'nova') diff --git a/nova/__init__.py b/nova/__init__.py index 1151ee639..1c886716f 100644 --- a/nova/__init__.py +++ b/nova/__init__.py @@ -1,7 +1,7 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the -# Administrator of the National Aeronautics and Space Administration. +# Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2010 Anso Labs, LLC diff --git a/nova/adminclient.py b/nova/adminclient.py index ef1ee03c0..fe873b8f7 100644 --- a/nova/adminclient.py +++ b/nova/adminclient.py @@ -1,7 +1,7 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the -# Administrator of the National Aeronautics and Space Administration. +# Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2010 Anso Labs, LLC diff --git a/nova/auth/__init__.py b/nova/auth/__init__.py index bfc5ef4d5..0d115e9d9 100644 --- a/nova/auth/__init__.py +++ b/nova/auth/__init__.py @@ -1,7 +1,7 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the -# Administrator of the National Aeronautics and Space Administration. +# Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2010 Anso Labs, LLC diff --git a/nova/auth/fakeldap.py b/nova/auth/fakeldap.py index 13b2435dd..27dde314d 100644 --- a/nova/auth/fakeldap.py +++ b/nova/auth/fakeldap.py @@ -1,7 +1,7 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the -# Administrator of the National Aeronautics and Space Administration. +# Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2010 Anso Labs, LLC diff --git a/nova/auth/novarc.template b/nova/auth/novarc.template index 91a3c68c8..b6d65297a 100644 --- a/nova/auth/novarc.template +++ b/nova/auth/novarc.template @@ -1,7 +1,7 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the -# Administrator of the National Aeronautics and Space Administration. +# Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2010 Anso Labs, LLC diff --git a/nova/auth/rbac.py b/nova/auth/rbac.py index eb85a3de1..f4abd1075 100644 --- a/nova/auth/rbac.py +++ b/nova/auth/rbac.py @@ -1,7 +1,7 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the -# Administrator of the National Aeronautics and Space Administration. +# Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2010 Anso Labs, LLC diff --git a/nova/auth/signer.py b/nova/auth/signer.py index 526a54262..4f7ac43bc 100644 --- a/nova/auth/signer.py +++ b/nova/auth/signer.py @@ -1,7 +1,7 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the -# Administrator of the National Aeronautics and Space Administration. +# Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2010 Anso Labs, LLC diff --git a/nova/auth/slap.sh b/nova/auth/slap.sh index ac2af422f..277ae2bcd 100755 --- a/nova/auth/slap.sh +++ b/nova/auth/slap.sh @@ -2,7 +2,7 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the -# Administrator of the National Aeronautics and Space Administration. +# Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2010 Anso Labs, LLC diff --git a/nova/auth/users.py b/nova/auth/users.py index 72c3c8466..6997596aa 100644 --- a/nova/auth/users.py +++ b/nova/auth/users.py @@ -2,7 +2,7 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the -# Administrator of the National Aeronautics and Space Administration. +# Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2010 Anso Labs, LLC diff --git a/nova/cloudpipe/__init__.py b/nova/cloudpipe/__init__.py index 5c35d696c..57ef14651 100644 --- a/nova/cloudpipe/__init__.py +++ b/nova/cloudpipe/__init__.py @@ -1,7 +1,7 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the -# Administrator of the National Aeronautics and Space Administration. +# Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2010 Anso Labs, LLC diff --git a/nova/cloudpipe/api.py b/nova/cloudpipe/api.py index 87283ef07..610239c2e 100644 --- a/nova/cloudpipe/api.py +++ b/nova/cloudpipe/api.py @@ -1,7 +1,7 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the -# Administrator of the National Aeronautics and Space Administration. +# Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2010 Anso Labs, LLC diff --git a/nova/cloudpipe/bootscript.sh b/nova/cloudpipe/bootscript.sh index 312258c22..639aad66f 100755 --- a/nova/cloudpipe/bootscript.sh +++ b/nova/cloudpipe/bootscript.sh @@ -2,7 +2,7 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the -# Administrator of the National Aeronautics and Space Administration. +# Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2010 Anso Labs, LLC diff --git a/nova/cloudpipe/client.ovpn.template b/nova/cloudpipe/client.ovpn.template index 80b5dab26..a8ec5dc6e 100644 --- a/nova/cloudpipe/client.ovpn.template +++ b/nova/cloudpipe/client.ovpn.template @@ -1,7 +1,7 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the -# Administrator of the National Aeronautics and Space Administration. +# Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2010 Anso Labs, LLC diff --git a/nova/cloudpipe/pipelib.py b/nova/cloudpipe/pipelib.py index 106a31368..09da71c64 100644 --- a/nova/cloudpipe/pipelib.py +++ b/nova/cloudpipe/pipelib.py @@ -1,7 +1,7 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the -# Administrator of the National Aeronautics and Space Administration. +# Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2010 Anso Labs, LLC diff --git a/nova/compute/__init__.py b/nova/compute/__init__.py index fe8d357a3..1c688c100 100644 --- a/nova/compute/__init__.py +++ b/nova/compute/__init__.py @@ -1,7 +1,7 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the -# Administrator of the National Aeronautics and Space Administration. +# Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2010 Anso Labs, LLC diff --git a/nova/compute/disk.py b/nova/compute/disk.py index 84329ae55..e7090dad3 100644 --- a/nova/compute/disk.py +++ b/nova/compute/disk.py @@ -1,7 +1,7 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the -# Administrator of the National Aeronautics and Space Administration. +# Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2010 Anso Labs, LLC diff --git a/nova/compute/exception.py b/nova/compute/exception.py index 829810bb0..b2bfc39e6 100644 --- a/nova/compute/exception.py +++ b/nova/compute/exception.py @@ -1,7 +1,7 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the -# Administrator of the National Aeronautics and Space Administration. +# Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2010 Anso Labs, LLC diff --git a/nova/compute/fakevirtinstance.xml b/nova/compute/fakevirtinstance.xml index 88cc623a8..0df76f5ef 100644 --- a/nova/compute/fakevirtinstance.xml +++ b/nova/compute/fakevirtinstance.xml @@ -1,6 +1,6 @@