include unixusers in pillar
This commit is contained in:
parent
607f9f57fb
commit
61357a596e
@ -99,13 +99,33 @@ public class JsonPillarServlet extends HttpServlet {
|
|||||||
final PacComponent pacQuota = pac.getPacComponent("QUOTA");
|
final PacComponent pacQuota = pac.getPacComponent("QUOTA");
|
||||||
if (pacQuota != null) {
|
if (pacQuota != null) {
|
||||||
int quota = pacQuota.getQuantity();
|
int quota = pacQuota.getQuantity();
|
||||||
writer.println(" , \"quota\": \"" + quota + "\"");
|
writer.println(" , \"quota\": " + quota);
|
||||||
}
|
}
|
||||||
final PacComponent pacOffice = pac.getPacComponent("OFFICE");
|
final PacComponent pacOffice = pac.getPacComponent("OFFICE");
|
||||||
if (pacOffice != null) {
|
if (pacOffice != null) {
|
||||||
int office = pacOffice.getQuantity();
|
int office = pacOffice.getQuantity();
|
||||||
writer.println(" , \"office\": \"" + office + "\"");
|
writer.println(" , \"office\": \"" + office + "\"");
|
||||||
}
|
}
|
||||||
|
writer.println(" , \"users\": [");
|
||||||
|
boolean firstLoopUsers = true;
|
||||||
|
final Set<UnixUser> users = pac.getUnixUser();
|
||||||
|
for (UnixUser user: users) {
|
||||||
|
if (firstLoopUsers) {
|
||||||
|
firstLoopUsers = false;
|
||||||
|
writer.println(" {");
|
||||||
|
} else {
|
||||||
|
writer.println(" , {");
|
||||||
|
}
|
||||||
|
writer.println(" \"user\": \"" + user.getName() + "\"");
|
||||||
|
writer.println(" , \"uid\": " + user.getUserId());
|
||||||
|
writer.println(" , \"comment\": \"" + user.getComment() + "\"");
|
||||||
|
writer.println(" , \"shell\": \"" + user.getShell() + "\"");
|
||||||
|
writer.println(" , \"homedir\": \"" + user.getHomedir() + "\"");
|
||||||
|
writer.println(" , \"quota_soft\": " + user.getQuotaSoftlimit());
|
||||||
|
writer.println(" , \"quota_hard\": " + user.getQuotaHardlimit());
|
||||||
|
writer.println(" }");
|
||||||
|
}
|
||||||
|
writer.println(" ]");
|
||||||
writer.println(" }");
|
writer.println(" }");
|
||||||
}
|
}
|
||||||
writer.println(" ]");
|
writer.println(" ]");
|
||||||
|
Loading…
Reference in New Issue
Block a user