~ubuntu-branches/ubuntu/raring/cinder/raring-updates

« back to all changes in this revision

Viewing changes to cinder/scheduler/simple.py

Tags: upstream-2013.1~g2
ImportĀ upstreamĀ versionĀ 2013.1~g2

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
simple_scheduler_opts = [
34
34
    cfg.IntOpt("max_gigabytes",
35
35
               default=10000,
36
 
               help="maximum number of volume gigabytes to allow per host"),
37
 
    ]
 
36
               help="maximum number of volume gigabytes to allow per host"), ]
38
37
 
39
38
FLAGS = flags.FLAGS
40
39
FLAGS.register_opts(simple_scheduler_opts)
63
62
            if not utils.service_is_up(service):
64
63
                raise exception.WillNotSchedule(host=host)
65
64
            updated_volume = driver.volume_update_db(context, volume_id, host)
66
 
            self.volume_rpcapi.create_volume(context, updated_volume,
67
 
                    host,
68
 
                    snapshot_id,
69
 
                    image_id)
 
65
            self.volume_rpcapi.create_volume(context,
 
66
                                             updated_volume,
 
67
                                             host,
 
68
                                             snapshot_id,
 
69
                                             image_id)
70
70
            return None
71
71
 
72
72
        results = db.service_get_all_volume_sorted(elevated)
81
81
            if utils.service_is_up(service) and not service['disabled']:
82
82
                updated_volume = driver.volume_update_db(context, volume_id,
83
83
                                                         service['host'])
84
 
                self.volume_rpcapi.create_volume(context, updated_volume,
85
 
                                            service['host'],
86
 
                                            snapshot_id,
87
 
                                            image_id)
 
84
                self.volume_rpcapi.create_volume(context,
 
85
                                                 updated_volume,
 
86
                                                 service['host'],
 
87
                                                 snapshot_id,
 
88
                                                 image_id)
88
89
                return None
89
90
        msg = _("Is the appropriate service running?")
90
91
        raise exception.NoValidHost(reason=msg)