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

« back to all changes in this revision

Viewing changes to cinder/volume/drivers/nfs.py

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

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
 
30
30
volume_opts = [
31
31
    cfg.StrOpt('nfs_shares_config',
32
 
                default=None,
33
 
                help='File with the list of available nfs shares'),
 
32
               default=None,
 
33
               help='File with the list of available nfs shares'),
34
34
    cfg.StrOpt('nfs_mount_point_base',
35
35
               default='$state_path/mnt',
36
36
               help='Base dir where nfs expected to be mounted'),
41
41
                default=True,
42
42
                help=('Create volumes as sparsed files which take no space.'
43
43
                      'If set to False volume is created as regular file.'
44
 
                      'In such case volume creation takes a lot of time.'))
45
 
]
 
44
                      'In such case volume creation takes a lot of time.'))]
46
45
 
47
46
FLAGS = flags.FLAGS
48
47
FLAGS.register_opts(volume_opts)
76
75
        """Just to override parent behavior"""
77
76
        pass
78
77
 
 
78
    def create_cloned_volume(self, volume, src_vref):
 
79
        raise NotImplementedError()
 
80
 
79
81
    def create_volume(self, volume):
80
82
        """Creates a volume"""
81
83
 
191
193
                self._ensure_share_mounted(share)
192
194
                self._mounted_shares.append(share)
193
195
            except Exception, exc:
194
 
                LOG.warning('Exception during mounting %s' % (exc,))
 
196
                LOG.warning(_('Exception during mounting %s') % (exc,))
195
197
 
196
198
        LOG.debug('Available shares %s' % str(self._mounted_shares))
197
199
 
226
228
 
227
229
        if volume_size_for * 1024 * 1024 * 1024 > greatest_size:
228
230
            raise exception.NfsNoSuitableShareFound(
229
 
                    volume_size=volume_size_for)
 
231
                volume_size=volume_size_for)
230
232
        return greatest_share
231
233
 
232
234
    def _get_mount_point_for_share(self, nfs_share):