~ubuntu-cloud-archive/ubuntu/precise/nova/trunk

« back to all changes in this revision

Viewing changes to nova/vsa/api.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short, Chuck Short, Adam Gandleman
  • Date: 2012-01-13 09:51:10 UTC
  • mfrom: (1.1.40)
  • Revision ID: package-import@ubuntu.com-20120113095110-ffd6163drcg77wez
Tags: 2012.1~e3~20120113.12049-0ubuntu1
[Chuck Short]
* New upstream version.
* debian/nova_sudoers, debian/nova-common.install, 
  Switch out to nova-rootwrap. (LP: #681774)
* Add "get-origsource-git" which allows developers to 
  generate a tarball from github, by doing:
  fakeroot debian/rules get-orig-source-git
* debian/debian/nova-objectstore.logrotate: Dont determine
  if we are running Debian or Ubuntu. (LP: #91379)

[Adam Gandleman]
* Removed python-nova.postinst, let dh_python2 generate instead since
  python-support is not a dependency. (LP: #907543)

Show diffs side-by-side

added added

removed removed

Lines of Context:
68
68
        super(API, self).__init__(**kwargs)
69
69
 
70
70
    def _check_volume_type_correctness(self, vol_type):
71
 
        if vol_type.get('extra_specs') == None or\
 
71
        if vol_type.get('extra_specs') is None or\
72
72
           vol_type['extra_specs'].get('type') != 'vsa_drive' or\
73
 
           vol_type['extra_specs'].get('drive_type') == None or\
74
 
           vol_type['extra_specs'].get('drive_size') == None:
 
73
           vol_type['extra_specs'].get('drive_type') is None or\
 
74
           vol_type['extra_specs'].get('drive_size') is None:
75
75
 
76
76
            raise exception.ApiError(_("Invalid drive type %s")
77
77
                                        % vol_type['name'])
162
162
        if storage is None:
163
163
            storage = []
164
164
 
165
 
        if shared is None or shared == 'False' or shared == False:
 
165
        if not shared or shared == 'False':
166
166
            shared = False
167
167
        else:
168
168
            shared = True
253
253
                                    volume_type=vol_type,
254
254
                                    metadata=dict(to_vsa_id=str(vsa_id)),
255
255
                                    availability_zone=availability_zone)
256
 
                except:
 
256
                except Exception:
257
257
                    self.update_vsa_status(context, vsa_id,
258
258
                                           status=VsaState.PARTIAL)
259
259
                    raise