If no profile is specified, trying to get its name results in a traceback.
Signed-off-by: Vratislav Podzimek vpodzime@redhat.com --- blivet/devices.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/blivet/devices.py b/blivet/devices.py index 56f8dcc..75afcc2 100644 --- a/blivet/devices.py +++ b/blivet/devices.py @@ -3584,10 +3584,15 @@ class LVMThinPoolDevice(LVMLogicalVolumeDevice): """ Create the device. """ log_method_call(self, self.name, status=self.status) # TODO: chunk size, data/metadata split --> profile + if self.profile: + profile_name = self.profile.name + else: + profile_name = "" + lvm.thinpoolcreate(self.vg.name, self.lvname, self.size, metadatasize=self.metaDataSize, chunksize=self.chunkSize, - profile=self.profile.name) + profile=profile_name)
def dracutSetupArgs(self): return set()
On Tue, Oct 21, 2014 at 09:45:48AM +0200, Vratislav Podzimek wrote:
If no profile is specified, trying to get its name results in a traceback.
Signed-off-by: Vratislav Podzimek vpodzime@redhat.com
blivet/devices.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/blivet/devices.py b/blivet/devices.py index 56f8dcc..75afcc2 100644 --- a/blivet/devices.py +++ b/blivet/devices.py @@ -3584,10 +3584,15 @@ class LVMThinPoolDevice(LVMLogicalVolumeDevice): """ Create the device. """ log_method_call(self, self.name, status=self.status) # TODO: chunk size, data/metadata split --> profile
if self.profile:
I think it might be a bit safer to do if hasattr(self.profile, "name"):
Otherwise ack.
profile_name = self.profile.name
else:
profile_name = ""
lvm.thinpoolcreate(self.vg.name, self.lvname, self.size, metadatasize=self.metaDataSize, chunksize=self.chunkSize,
profile=self.profile.name)
profile=profile_name)
def dracutSetupArgs(self): return set()
-- 1.9.3
anaconda-patches mailing list anaconda-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
----- Original Message -----
From: "Vratislav Podzimek" vpodzime@redhat.com To: anaconda-patches@lists.fedorahosted.org Sent: Tuesday, October 21, 2014 3:45:48 AM Subject: [blivet:all][PATCH] Don't try to get no profile's name (#1151458)
If no profile is specified, trying to get its name results in a traceback.
Signed-off-by: Vratislav Podzimek vpodzime@redhat.com
blivet/devices.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/blivet/devices.py b/blivet/devices.py index 56f8dcc..75afcc2 100644 --- a/blivet/devices.py +++ b/blivet/devices.py @@ -3584,10 +3584,15 @@ class LVMThinPoolDevice(LVMLogicalVolumeDevice): """ Create the device. """ log_method_call(self, self.name, status=self.status) # TODO: chunk size, data/metadata split --> profile
if self.profile:
profile_name = self.profile.name
else:
profile_name = ""
lvm.thinpoolcreate(self.vg.name, self.lvname, self.size, metadatasize=self.metaDataSize, chunksize=self.chunkSize,
profile=self.profile.name)
profile=profile_name)
def dracutSetupArgs(self): return set()
-- 1.9.3
anaconda-patches mailing list anaconda-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
It looks to me like it might make sense to fix this class's populateKSData() method at the same time so that data.profile is the str name, not the ThPoolProfile object. Or you could make fix related to rhbz#869456.
Also, right next to them metaDataSize and chunkSize definitely have similar unit/type problems...but those difficulties seem of long standing and a bit harder to fix. Since you know more about lvm though, you might want to take a look.
Also, I can't find any mention of the --profile option in current RHEL7 installation guide. Maybe it's worth filing a bug so that they can put it in?
I concur w/ Samantha on hasattr...but I think getattr with a default would be a bit better.
- mulhern
On Tue, 2014-10-21 at 08:27 -0400, Anne Mulhern wrote:
----- Original Message -----
From: "Vratislav Podzimek" vpodzime@redhat.com To: anaconda-patches@lists.fedorahosted.org Sent: Tuesday, October 21, 2014 3:45:48 AM Subject: [blivet:all][PATCH] Don't try to get no profile's name (#1151458)
If no profile is specified, trying to get its name results in a traceback.
Signed-off-by: Vratislav Podzimek vpodzime@redhat.com
blivet/devices.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/blivet/devices.py b/blivet/devices.py index 56f8dcc..75afcc2 100644 --- a/blivet/devices.py +++ b/blivet/devices.py @@ -3584,10 +3584,15 @@ class LVMThinPoolDevice(LVMLogicalVolumeDevice): """ Create the device. """ log_method_call(self, self.name, status=self.status) # TODO: chunk size, data/metadata split --> profile
if self.profile:
profile_name = self.profile.name
else:
profile_name = ""
lvm.thinpoolcreate(self.vg.name, self.lvname, self.size, metadatasize=self.metaDataSize, chunksize=self.chunkSize,
profile=self.profile.name)
profile=profile_name)
def dracutSetupArgs(self): return set()
-- 1.9.3
anaconda-patches mailing list anaconda-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
It looks to me like it might make sense to fix this class's populateKSData() method at the same time so that data.profile is the str name, not the ThPoolProfile object. Or you could make fix related to rhbz#869456.
Good catch! Fixing locally.
Also, right next to them metaDataSize and chunkSize definitely have similar unit/type problems...but those difficulties seem of long standing and a bit harder to fix. Since you know more about lvm though, you might want to take a look.
These are okay, I think, because they default to 0 which is then ignored by LogVolData when producing its string representation.
Also, I can't find any mention of the --profile option in current RHEL7 installation guide. Maybe it's worth filing a bug so that they can put it in?
I could clone the bug rhbz#869456 to documentation, but I feel like we need some more general approach here for new stuff in 7.1.
I concur w/ Samantha on hasattr...but I think getattr with a default would be a bit better.
I've discussed this with Samantha on IRC I think that anyone passing something else then ThPoolProfile as the profile argument (and I expect me to be the first one) deserves that to blow out into their face as it means something wrong is happenning somewhere.
anaconda-patches@lists.fedorahosted.org