Compare commits
No commits in common. "03184f6e582ce521685f101a094e7a925cc8e77e" and "ce81c4a0c19ee93ef55808d4faf139f9db6f15a0" have entirely different histories.
03184f6e58
...
ce81c4a0c1
@ -8,15 +8,13 @@ import java.util.regex.Pattern;
|
||||
|
||||
import static net.hostsharing.hsadminng.hs.hosting.asset.HsHostingAssetType.MANAGED_WEBSPACE;
|
||||
import static net.hostsharing.hsadminng.hs.hosting.asset.HsHostingAssetType.UNIX_USER;
|
||||
import static net.hostsharing.hsadminng.hs.validation.IntegerProperty.integerProperty;
|
||||
|
||||
class HsManagedWebspaceHostingAssetValidator extends HostingAssetEntityValidator {
|
||||
public HsManagedWebspaceHostingAssetValidator() {
|
||||
super(
|
||||
MANAGED_WEBSPACE,
|
||||
AlarmContact.isOptional(),
|
||||
integerProperty("groupid").readOnly()
|
||||
);
|
||||
NO_EXTRA_PROPERTIES); // TODO.impl: groupid missing, should be equal to main user
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -45,7 +43,6 @@ class HsManagedWebspaceHostingAssetValidator extends HostingAssetEntityValidator
|
||||
.prepareForSave()
|
||||
.saveUsing(emw::persist)
|
||||
.validateContext();
|
||||
webspaceAsset.getConfig().put("groupid", unixUserAsset.getConfig().get("userid"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -176,9 +176,7 @@ class HsHostingAssetControllerAcceptanceTest extends ContextBasedTestWithCleanup
|
||||
"type": "MANAGED_WEBSPACE",
|
||||
"identifier": "fir10",
|
||||
"caption": "some separate ManagedWebspace HA",
|
||||
"config": {
|
||||
"groupid": 1000000
|
||||
}
|
||||
"config": {}
|
||||
}
|
||||
"""))
|
||||
.header("Location", matchesRegex("http://localhost:[1-9][0-9]*/api/hs/hosting/assets/[^/]*"))
|
||||
|
@ -350,18 +350,6 @@ public class ImportHostingAssets extends BaseOfficeDataImport {
|
||||
9596=HsHostingAsset(UNIX_USER, dph00-dph, Domain admin, MANAGED_WEBSPACE:dph00, {"SSD hard quota": 0, "SSD soft quota": 0, "locked": false, "shell": "/bin/bash", "userid": 110594})
|
||||
}
|
||||
""");
|
||||
|
||||
// now with groupids
|
||||
assertThat(firstOfEach(5, packetAssets, MANAGED_WEBSPACE))
|
||||
.isEqualToIgnoringWhitespace("""
|
||||
{
|
||||
10630=HsHostingAsset(MANAGED_WEBSPACE, hsh00, HA hsh00, MANAGED_SERVER:vm1050, D-1000000:hsh default project:BI hsh00, {"groupid": 6824}),
|
||||
11094=HsHostingAsset(MANAGED_WEBSPACE, lug00, HA lug00, MANAGED_SERVER:vm1068, D-1000300:mim default project:BI lug00, {"groupid": 5803}),
|
||||
11111=HsHostingAsset(MANAGED_WEBSPACE, xyz68, HA xyz68, MANAGED_SERVER:vm1068, D-1000000:vm1068 Monitor:BI xyz68, {"groupid": 5961}),
|
||||
11112=HsHostingAsset(MANAGED_WEBSPACE, mim00, HA mim00, MANAGED_SERVER:vm1068, D-1000300:mim default project:BI mim00, {"groupid": 5964}),
|
||||
19959=HsHostingAsset(MANAGED_WEBSPACE, dph00, HA dph00, MANAGED_SERVER:vm1093, D-1101900:dph default project:BI dph00, {"groupid": 9546})
|
||||
}
|
||||
""");
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -1247,10 +1235,9 @@ public class ImportHostingAssets extends BaseOfficeDataImport {
|
||||
.forEach(rec -> {
|
||||
final var unixuser_id = rec.getInteger("unixuser_id");
|
||||
final var packet_id = rec.getInteger("packet_id");
|
||||
final var parentWebspaceAsset = packetAssets.get(packet_id);
|
||||
final var unixUserAsset = HsHostingAssetRealEntity.builder()
|
||||
.type(UNIX_USER)
|
||||
.parentAsset(parentWebspaceAsset)
|
||||
.parentAsset(packetAssets.get(packet_id))
|
||||
.identifier(rec.getString("name"))
|
||||
.caption(rec.getString("comment"))
|
||||
.isLoaded(true) // avoid overwriting imported userids with generated ids
|
||||
@ -1266,10 +1253,6 @@ public class ImportHostingAssets extends BaseOfficeDataImport {
|
||||
)))
|
||||
.build();
|
||||
|
||||
if (unixUserAsset.getIdentifier().equals(parentWebspaceAsset.getIdentifier())) {
|
||||
parentWebspaceAsset.getConfig().put("groupid", unixuser_id);
|
||||
}
|
||||
|
||||
// TODO.spec: crop SSD+HDD limits if > booked
|
||||
if (unixUserAsset.getDirectValue("SSD hard quota", Integer.class, 0)
|
||||
> 1024 * unixUserAsset.getContextValue("SSD", Integer.class, 0)) {
|
||||
|
Loading…
Reference in New Issue
Block a user