mirror of https://github.com/apache/cloudstack.git
cloudian: add mandatory/missing user attribute
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
parent
e9244cf341
commit
738b89b56e
|
|
@ -21,15 +21,18 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
|||
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class UserInfo {
|
||||
public static final String USER = "User";
|
||||
|
||||
String userId;
|
||||
String groupId;
|
||||
String userType;
|
||||
Boolean active;
|
||||
String fullName;
|
||||
String canonicalUserId;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format("User [id=%s, group id=%s, active=%s, name=%s]", userId, groupId, active, fullName);
|
||||
return String.format("User [id=%s, group id=%s, type=%s, active=%s, name=%s]", userId, groupId, userType, active, fullName);
|
||||
}
|
||||
|
||||
public String getUserId() {
|
||||
|
|
@ -48,6 +51,14 @@ public class UserInfo {
|
|||
this.groupId = groupId;
|
||||
}
|
||||
|
||||
public String getUserType() {
|
||||
return userType;
|
||||
}
|
||||
|
||||
public void setUserType(String userType) {
|
||||
this.userType = userType;
|
||||
}
|
||||
|
||||
public String getFullName() {
|
||||
return fullName;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -109,9 +109,9 @@ public class CloudianConnectorImpl extends ComponentLifecycleBase implements Clo
|
|||
}
|
||||
LOG.debug("Adding Cloudian group against domain uuid=" + domain.getUuid() + " name=" + domain.getName() + " path=" + domain.getPath());
|
||||
GroupInfo group = new GroupInfo();
|
||||
group.setActive(true);
|
||||
group.setGroupId(domain.getUuid());
|
||||
group.setGroupName(domain.getPath());
|
||||
group.setActive(true);
|
||||
GroupInfo createdGroup = client.addGroup(group);
|
||||
return createdGroup != null && createdGroup.getGroupId().equals(domain.getUuid());
|
||||
}
|
||||
|
|
@ -136,10 +136,11 @@ public class CloudianConnectorImpl extends ComponentLifecycleBase implements Clo
|
|||
LOG.debug("Adding Cloudian user account with uuid=" + account.getUuid() + " name=" + account.getAccountName());
|
||||
final Domain domain = domainDao.findById(account.getDomainId());
|
||||
UserInfo user = new UserInfo();
|
||||
user.setActive(true);
|
||||
user.setUserId(account.getUuid());
|
||||
user.setGroupId(domain.getUuid());
|
||||
user.setUserType(UserInfo.USER);
|
||||
user.setFullName(account.getAccountName());
|
||||
user.setActive(true);
|
||||
UserInfo createdUser = client.addUser(user);
|
||||
return createdUser != null && createdUser.getUserId().equals(account.getUuid());
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue