|
|
@@ -188,7 +188,12 @@ class Hdfs(object):
|
|
|
self.setuser(self.superuser)
|
|
|
self.mkdir(home_path)
|
|
|
self.chmod(home_path, mode)
|
|
|
- self.chown(home_path, user, user)
|
|
|
+ self.chown(home_path, user)
|
|
|
+ try: # Handle the case when there is no group with the same name as the user.
|
|
|
+ self.chown(home_path, group=user)
|
|
|
+ except IOError:
|
|
|
+ LOG.exception('Failed to change the group of "{}" to "{}" when creating a home directory '
|
|
|
+ 'for user "{}"'.format(home_path, user, user))
|
|
|
except IOError:
|
|
|
msg = 'Failed to create home dir ("%s") as superuser %s' % (home_path, self.superuser)
|
|
|
LOG.exception(msg)
|