Lines Matching refs:self
53 def __init__(self, *args, **kwargs):
54 super(ZfsNfsVolumeDriver, self).__init__(*args, **kwargs)
55 self.configuration.append_config_values(solaris_zfs_nfs_opts)
57 self.last_rr_pos = None
59 if self.configuration.nfs_mount_options:
62 def _update_volume_stats(self):
66 backend_name = self.configuration.safe_get('volume_backend_name')
67 stats["volume_backend_name"] = backend_name or self.__class__.__name__
70 stats['storage_protocol'] = self.driver_volume_type
72 self._ensure_shares_mounted()
76 for share in self._mounted_shares:
77 capacity, free, used = self._get_capacity_info(share)
85 self._stats = stats
87 def _create_sparsed_file(self, path, size):
89 self._execute('/usr/bin/truncate', '-s', '%sG' % size, path)
91 def _create_regular_file(self, path, size):
97 self._execute('/usr/bin/dd', 'if=/dev/zero', 'of=%s' % path,
101 def _set_rw_permissions(self, path):
108 def _set_rw_permissions_for_all(self, path):
113 def _set_rw_permissions_for_owner(self, path):
118 def _delete(self, path):
121 def _get_capacity_info(self, nfs_share):
127 mount_point = self._get_mount_point_for_share(nfs_share)
133 du, _ = self._execute('/usr/bin/gdu', '-sb', '--apparent-size',
138 def _round_robin(self, sharelist):
145 if self.last_rr_pos is None:
148 start_pos = (self.last_rr_pos + 1) % mylen
157 def _find_share(self, volume_size_in_gib):
166 if not self._mounted_shares:
170 if self.configuration.nfs_round_robin:
175 for nfs_share, pos in self._round_robin(self._mounted_shares):
176 if not self._is_share_eligible(nfs_share, volume_size_in_gib):
179 self.last_rr_pos = pos
188 for nfs_share in self._mounted_shares:
189 if not self._is_share_eligible(nfs_share, volume_size_in_gib):
192 self._get_capacity_info(nfs_share)
209 def extend_volume(self, volume, new_size):
213 if not self._is_share_eligible(volume['provider_location'],
218 path = self.local_path(volume)
220 self._execute('/usr/bin/truncate', '-s', '%sG' % new_size, path)
222 def set_nas_security_options(self, is_new_cinder_install):
237 self.configuration.nas_secure_file_operations = 'true'
238 self.configuration.nas_secure_file_permissions = 'true'
239 self._execute_as_root = False
242 self.configuration.nas_secure_file_permissions)
245 self.configuration.nas_secure_file_operations)