[node-patches] Change in ovirt-node[master]: Unset the NFSv4 domain in idmapd.conf when it's unset in the...
rbarry at redhat.com
rbarry at redhat.com
Mon Oct 28 15:31:20 UTC 2013
Ryan Barry has uploaded a new change for review.
Change subject: Unset the NFSv4 domain in idmapd.conf when it's unset in the TUI
......................................................................
Unset the NFSv4 domain in idmapd.conf when it's unset in the TUI
Previously, removing the NFSv4 domain did not properly clear the
configuration in idmapd.conf. Check that it's not an empty string,
and comment out "Domain", as well as setting it to a null value so
we can reset it again.
Change-Id: Ie689b27fe8808ffed2b50bde347e03a970aba2c8
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=960833
Signed-off-by: Ryan Barry <rbarry at redhat.com>
---
M src/ovirt/node/utils/storage.py
1 file changed, 9 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/21/20621/1
diff --git a/src/ovirt/node/utils/storage.py b/src/ovirt/node/utils/storage.py
index a050090..8958b70 100644
--- a/src/ovirt/node/utils/storage.py
+++ b/src/ovirt/node/utils/storage.py
@@ -44,12 +44,13 @@
configfilename = "/etc/idmapd.conf"
def domain(self, domain=None):
- if domain:
+ if domain is not None:
self.__set_domain(domain)
return self.__get_domain()
def __set_domain(self, domain):
current_domain = self.__get_domain()
+ print(current_domain)
cmd = None
if current_domain.startswith("#"):
current_domain = ("#Domain = %s" %
@@ -57,8 +58,13 @@
cmd = ['sed', '-i', '-c', 's/%s/Domain = %s/g' %
(current_domain, domain), self.configfilename]
else:
- cmd = ['sed', '-i', '-c', '/^Domain/ s/%s/%s/g' %
- (current_domain, domain), self.configfilename]
+ if domain is "":
+ cmd = ['sed', '-i', '-c', '/^Domain/ s/.*/#Domain = empty/g' %
+ (current_domain, domain), self.configfilename]
+ else:
+ cmd = ['sed', '-i', '-c', '/^Domain/ s/%s/%s/g' %
+ (current_domain, domain), self.configfilename]
+ print(cmd)
process.check_call(cmd)
def __get_domain(self):
--
To view, visit http://gerrit.ovirt.org/20621
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie689b27fe8808ffed2b50bde347e03a970aba2c8
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Ryan Barry <rbarry at redhat.com>
More information about the node-patches
mailing list