Commit 9051387e authored by Xavier Thompson's avatar Xavier Thompson

slapformat: WIP: Rename creatPath and createUser into ensurePath and ensureUser

parent 0588d597
......@@ -258,7 +258,7 @@ class Computer(object):
# Software root path
ensureDir(self.conf.software_root, 0o755)
# Software user
self.user.createUser()
self.user.ensureUser()
uid, gid = self.user.getIds()
os.chown(self.conf.software_root, uid, gid)
# Non local bind for IPv6 ranges
......@@ -428,8 +428,8 @@ class Partition(object):
# XXX
def format(self, interface):
self.user.createUser()
self.createPath()
self.user.ensureUser()
self.ensurePath()
for ip in self.ipv4_list:
interface.addAddress(ip, self.reference)
for ip in self.ipv6_list:
......@@ -441,7 +441,7 @@ class Partition(object):
for ip in self.ipv6_list:
interface.checkAddress(ip, self.reference)
def createPath(self):
def ensurePath(self):
if not os.path.exists(self.path):
os.mkdir(self.path)
uid, gid = self.user.getIds()
......@@ -461,7 +461,7 @@ class User(object):
self.path = path
self.groups = groups
def createUser(self):
def ensureUser(self):
groupname = 'grp_' + self.name if sys.platform == 'cygwin' else self.name
if not self.groupExists(groupname):
call(['groupadd', groupname])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment