Skip to content

Commit

Permalink
Remove the virtualization code
Browse files Browse the repository at this point in the history
  • Loading branch information
cbosdo committed Sep 19, 2024
1 parent ec6b1aa commit 2c7ece3
Show file tree
Hide file tree
Showing 344 changed files with 131 additions and 32,205 deletions.
7 changes: 2 additions & 5 deletions java/code/src/com/redhat/rhn/GlobalInstanceHolder.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import com.suse.manager.kubernetes.KubernetesManager;
import com.suse.manager.utils.SaltKeyUtils;
import com.suse.manager.utils.SaltUtils;
import com.suse.manager.virtualization.VirtManagerSalt;
import com.suse.manager.webui.controllers.bootstrap.RegularMinionBootstrapper;
import com.suse.manager.webui.controllers.bootstrap.SSHMinionBootstrapper;
import com.suse.manager.webui.menu.MenuTree;
Expand All @@ -42,7 +41,6 @@
import com.suse.manager.webui.services.iface.MonitoringManager;
import com.suse.manager.webui.services.iface.SaltApi;
import com.suse.manager.webui.services.iface.SystemQuery;
import com.suse.manager.webui.services.iface.VirtManager;
import com.suse.manager.webui.services.impl.SaltService;
import com.suse.manager.webui.utils.MinionActionUtils;
import com.suse.manager.webui.utils.UserPreferenceUtils;
Expand Down Expand Up @@ -79,15 +77,14 @@ private GlobalInstanceHolder() {
public static final RenderUtils RENDER_UTILS = new RenderUtils(ACL_FACTORY);
public static final MinionActionUtils MINION_ACTION_UTILS = new MinionActionUtils(SALT_API, SALT_UTILS);
public static final KubernetesManager KUBERNETES_MANAGER = new KubernetesManager(SALT_API);
public static final VirtManager VIRT_MANAGER = new VirtManagerSalt(SALT_API);
public static final RegularMinionBootstrapper REGULAR_MINION_BOOTSTRAPPER =
new RegularMinionBootstrapper(SYSTEM_QUERY, SALT_API, PAYG_MANAGER, ATTESTATION_MANAGER);
public static final SSHMinionBootstrapper SSH_MINION_BOOTSTRAPPER =
new SSHMinionBootstrapper(SYSTEM_QUERY, SALT_API, PAYG_MANAGER, ATTESTATION_MANAGER);
public static final MonitoringManager MONITORING_MANAGER = new FormulaMonitoringManager(SALT_API);
public static final SystemEntitlementManager SYSTEM_ENTITLEMENT_MANAGER = new SystemEntitlementManager(
new SystemUnentitler(VIRT_MANAGER, MONITORING_MANAGER, SERVER_GROUP_MANAGER),
new SystemEntitler(SALT_API, VIRT_MANAGER, MONITORING_MANAGER,
new SystemUnentitler(MONITORING_MANAGER, SERVER_GROUP_MANAGER),
new SystemEntitler(SALT_API, MONITORING_MANAGER,
SERVER_GROUP_MANAGER)
);
public static final SystemManager SYSTEM_MANAGER = new SystemManager(ServerFactory.SINGLETON,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,8 @@
import com.redhat.rhn.testing.TestUtils;
import com.redhat.rhn.testing.UserTestUtils;

import com.suse.manager.virtualization.VirtManagerSalt;
import com.suse.manager.webui.services.iface.MonitoringManager;
import com.suse.manager.webui.services.iface.SaltApi;
import com.suse.manager.webui.services.iface.VirtManager;
import com.suse.manager.webui.services.test.TestSaltApi;

import org.junit.jupiter.api.BeforeEach;
Expand All @@ -69,11 +67,10 @@ public class AccessTest extends BaseTestCaseWithUser {
private Acl acl;
private final SaltApi saltApi = new TestSaltApi();
private final ServerGroupManager serverGroupManager = new ServerGroupManager(saltApi);
private final VirtManager virtManager = new VirtManagerSalt(saltApi);
private final MonitoringManager monitoringManager = new FormulaMonitoringManager(saltApi);
private final SystemEntitlementManager systemEntitlementManager = new SystemEntitlementManager(
new SystemUnentitler(virtManager, monitoringManager, serverGroupManager),
new SystemEntitler(saltApi, virtManager, monitoringManager, serverGroupManager)
new SystemUnentitler(monitoringManager, serverGroupManager),
new SystemEntitler(saltApi, monitoringManager, serverGroupManager)
);

@Override
Expand Down
227 changes: 0 additions & 227 deletions java/code/src/com/redhat/rhn/domain/action/ActionFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,26 +52,6 @@
import com.redhat.rhn.domain.action.script.ScriptActionDetails;
import com.redhat.rhn.domain.action.script.ScriptRunAction;
import com.redhat.rhn.domain.action.server.ServerAction;
import com.redhat.rhn.domain.action.virtualization.BaseVirtualizationVolumeAction;
import com.redhat.rhn.domain.action.virtualization.VirtualizationCreateGuestAction;
import com.redhat.rhn.domain.action.virtualization.VirtualizationDeleteGuestAction;
import com.redhat.rhn.domain.action.virtualization.VirtualizationDestroyGuestAction;
import com.redhat.rhn.domain.action.virtualization.VirtualizationMigrateGuestAction;
import com.redhat.rhn.domain.action.virtualization.VirtualizationNetworkCreateAction;
import com.redhat.rhn.domain.action.virtualization.VirtualizationNetworkStateChangeAction;
import com.redhat.rhn.domain.action.virtualization.VirtualizationPoolCreateAction;
import com.redhat.rhn.domain.action.virtualization.VirtualizationPoolDeleteAction;
import com.redhat.rhn.domain.action.virtualization.VirtualizationPoolRefreshAction;
import com.redhat.rhn.domain.action.virtualization.VirtualizationPoolStartAction;
import com.redhat.rhn.domain.action.virtualization.VirtualizationPoolStopAction;
import com.redhat.rhn.domain.action.virtualization.VirtualizationRebootGuestAction;
import com.redhat.rhn.domain.action.virtualization.VirtualizationResumeGuestAction;
import com.redhat.rhn.domain.action.virtualization.VirtualizationSchedulePollerAction;
import com.redhat.rhn.domain.action.virtualization.VirtualizationSetMemoryGuestAction;
import com.redhat.rhn.domain.action.virtualization.VirtualizationSetVcpusGuestAction;
import com.redhat.rhn.domain.action.virtualization.VirtualizationShutdownGuestAction;
import com.redhat.rhn.domain.action.virtualization.VirtualizationStartGuestAction;
import com.redhat.rhn.domain.action.virtualization.VirtualizationSuspendGuestAction;
import com.redhat.rhn.domain.config.ConfigRevision;
import com.redhat.rhn.domain.rhnpackage.PackageEvr;
import com.redhat.rhn.domain.rhnpackage.PackageEvrFactory;
Expand Down Expand Up @@ -419,72 +399,12 @@ else if (typeIn.equals(TYPE_KICKSTART_INITIATE_GUEST)) {
else if (typeIn.equals(TYPE_DAEMON_CONFIG)) {
retval = new DaemonConfigAction();
}
else if (typeIn.equals(TYPE_VIRTUALIZATION_SHUTDOWN)) {
retval = new VirtualizationShutdownGuestAction();
}
else if (typeIn.equals(TYPE_VIRTUALIZATION_START)) {
retval = new VirtualizationStartGuestAction();
}
else if (typeIn.equals(TYPE_VIRTUALIZATION_SUSPEND)) {
retval = new VirtualizationSuspendGuestAction();
}
else if (typeIn.equals(TYPE_VIRTUALIZATION_RESUME)) {
retval = new VirtualizationResumeGuestAction();
}
else if (typeIn.equals(TYPE_VIRTUALIZATION_REBOOT)) {
retval = new VirtualizationRebootGuestAction();
}
else if (typeIn.equals(TYPE_VIRTUALIZATION_DESTROY)) {
retval = new VirtualizationDestroyGuestAction();
}
else if (typeIn.equals(TYPE_VIRTUALIZATION_DELETE)) {
retval = new VirtualizationDeleteGuestAction();
}
else if (typeIn.equals(TYPE_VIRTUALIZATION_SET_MEMORY)) {
retval = new VirtualizationSetMemoryGuestAction();
}
else if (typeIn.equals(TYPE_VIRTUALIZATION_SET_VCPUS)) {
retval = new VirtualizationSetVcpusGuestAction();
}
else if (typeIn.equals(TYPE_VIRTUALIZATION_GUEST_MIGRATE)) {
retval = new VirtualizationMigrateGuestAction();
}
else if (typeIn.equals(TYPE_VIRTUALIZATION_SCHEDULE_POLLER)) {
retval = new VirtualizationSchedulePollerAction();
}
else if (typeIn.equals(TYPE_VIRTIZATION_HOST_SUBSCRIBE_TO_TOOLS_CHANNEL)) {
retval = new KickstartHostToolsChannelSubscriptionAction();
}
else if (typeIn.equals(TYPE_VIRTUALIZATION_GUEST_SUBSCRIBE_TO_TOOLS_CHANNEL)) {
retval = new KickstartGuestToolsChannelSubscriptionAction();
}
else if (typeIn.equals(TYPE_VIRTUALIZATION_CREATE)) {
retval = new VirtualizationCreateGuestAction();
}
else if (typeIn.equals(TYPE_VIRTUALIZATION_POOL_REFRESH)) {
retval = new VirtualizationPoolRefreshAction();
}
else if (typeIn.equals(TYPE_VIRTUALIZATION_POOL_START)) {
retval = new VirtualizationPoolStartAction();
}
else if (typeIn.equals(TYPE_VIRTUALIZATION_POOL_STOP)) {
retval = new VirtualizationPoolStopAction();
}
else if (typeIn.equals(TYPE_VIRTUALIZATION_POOL_DELETE)) {
retval = new VirtualizationPoolDeleteAction();
}
else if (typeIn.equals(TYPE_VIRTUALIZATION_POOL_CREATE)) {
retval = new VirtualizationPoolCreateAction();
}
else if (typeIn.equals(TYPE_VIRTUALIZATION_VOLUME_DELETE)) {
retval = new BaseVirtualizationVolumeAction();
}
else if (typeIn.equals(TYPE_VIRTUALIZATION_NETWORK_STATE_CHANGE)) {
retval = new VirtualizationNetworkStateChangeAction();
}
else if (typeIn.equals(TYPE_VIRTUALIZATION_NETWORK_CREATE)) {
retval = new VirtualizationNetworkCreateAction();
}
else if (typeIn.equals(TYPE_SCAP_XCCDF_EVAL)) {
retval = new ScapAction();
}
Expand Down Expand Up @@ -1008,33 +928,6 @@ public static void delete(ServerAction serverAction) {
singleton.removeObject(serverAction);
}

/**
* Return whether an action type is a virtualization one.
*
* @param actionType type to check
* @return true if it is a virtualization action type
*/
public static boolean isVirtualizationActionType(ActionType actionType) {
return actionType.equals(TYPE_VIRTUALIZATION_CREATE) ||
actionType.equals(TYPE_VIRTUALIZATION_DELETE) ||
actionType.equals(TYPE_VIRTUALIZATION_DESTROY) ||
actionType.equals(TYPE_VIRTUALIZATION_REBOOT) ||
actionType.equals(TYPE_VIRTUALIZATION_RESUME) ||
actionType.equals(TYPE_VIRTUALIZATION_SET_MEMORY) ||
actionType.equals(TYPE_VIRTUALIZATION_SET_VCPUS) ||
actionType.equals(TYPE_VIRTUALIZATION_SHUTDOWN) ||
actionType.equals(TYPE_VIRTUALIZATION_START) ||
actionType.equals(TYPE_VIRTUALIZATION_SUSPEND) ||
actionType.equals(TYPE_VIRTUALIZATION_GUEST_MIGRATE) ||
actionType.equals(TYPE_VIRTUALIZATION_POOL_CREATE) ||
actionType.equals(TYPE_VIRTUALIZATION_POOL_DELETE) ||
actionType.equals(TYPE_VIRTUALIZATION_POOL_REFRESH) ||
actionType.equals(TYPE_VIRTUALIZATION_POOL_START) ||
actionType.equals(TYPE_VIRTUALIZATION_POOL_STOP) ||
actionType.equals(TYPE_VIRTUALIZATION_NETWORK_STATE_CHANGE) ||
actionType.equals(TYPE_VIRTUALIZATION_NETWORK_CREATE);
}

/**
* The constant representing the Action Status QUEUED
*/
Expand Down Expand Up @@ -1243,60 +1136,6 @@ public static boolean isVirtualizationActionType(ActionType actionType) {
public static final ActionType TYPE_ROLLBACK_ROLLBACK =
lookupActionTypeByLabel("rollback.rollback");

/**
* The constant representing "Shuts down a Xen domain." [ID:36]
*/
public static final ActionType TYPE_VIRTUALIZATION_SHUTDOWN =
lookupActionTypeByLabel("virt.shutdown");

/**
* The constant representing "Starts up a Xen domain." [ID:37]
*/
public static final ActionType TYPE_VIRTUALIZATION_START =
lookupActionTypeByLabel("virt.start");

/**
* The constant representing "Suspends a Xen domain." [ID:38]
*/
public static final ActionType TYPE_VIRTUALIZATION_SUSPEND =
lookupActionTypeByLabel("virt.suspend");

/**
* The constant representing "Resumes a Xen domain." [ID:39]
*/
public static final ActionType TYPE_VIRTUALIZATION_RESUME =
lookupActionTypeByLabel("virt.resume");

/**
* The constant representing "Reboots a Xen domain." [ID:40]
*/
public static final ActionType TYPE_VIRTUALIZATION_REBOOT =
lookupActionTypeByLabel("virt.reboot");

/**
* The constant representing "Destroys a Xen Domain." [ID:41]
*/
public static final ActionType TYPE_VIRTUALIZATION_DESTROY =
lookupActionTypeByLabel("virt.destroy");

/**
* The constant representing "Sets the maximum memory usage for a Xen domain." [ID:42]
*/
public static final ActionType TYPE_VIRTUALIZATION_SET_MEMORY =
lookupActionTypeByLabel("virt.setMemory");

/**
* The constant representing "Sets the Vcpu usage for a Xen domain." [ID:48]
*/
public static final ActionType TYPE_VIRTUALIZATION_SET_VCPUS =
lookupActionTypeByLabel("virt.setVCPUs");

/**
* The constant representing "Sets when the poller should run." [ID:43]
*/
public static final ActionType TYPE_VIRTUALIZATION_SCHEDULE_POLLER =
lookupActionTypeByLabel("virt.schedulePoller");

/**
* The constant representing "Schedule a package install of host specific
* functionality." [ID:44]
Expand Down Expand Up @@ -1370,77 +1209,11 @@ public static boolean isVirtualizationActionType(ActionType actionType) {
public static final ActionType TYPE_SUBSCRIBE_CHANNELS =
lookupActionTypeByLabel("channels.subscribe");

/**
* The constant representing "Deletes a virtual domain." [ID:507]
*/
public static final ActionType TYPE_VIRTUALIZATION_DELETE =
lookupActionTypeByLabel("virt.delete");

/**
* The constant representing "Creates a virtual domain." [ID:508]
*/
public static final ActionType TYPE_VIRTUALIZATION_CREATE =
lookupActionTypeByLabel("virt.create");

/**
* The constant representing "Refresh a virtual storage pool." [ID:509]
*/
public static final ActionType TYPE_VIRTUALIZATION_POOL_REFRESH =
lookupActionTypeByLabel("virt.pool_refresh");

/**
* The constant representing "Start a virtual storage pool." [ID:510]
*/
public static final ActionType TYPE_VIRTUALIZATION_POOL_START =
lookupActionTypeByLabel("virt.pool_start");

/**
* The constant representing "Stops a virtual storage pool." [ID:511]
*/
public static final ActionType TYPE_VIRTUALIZATION_POOL_STOP =
lookupActionTypeByLabel("virt.pool_stop");

/**
* The constant representing "Deletes a virtual storage pool." [ID:512]
*/
public static final ActionType TYPE_VIRTUALIZATION_POOL_DELETE =
lookupActionTypeByLabel("virt.pool_delete");

/**
* The constant representing "Creates a virtual storage pool." [ID:513]
*/
public static final ActionType TYPE_VIRTUALIZATION_POOL_CREATE =
lookupActionTypeByLabel("virt.pool_create");

/**
* The constant representing "Deletes a virtual storage volume" [ID:514]
*/
public static final ActionType TYPE_VIRTUALIZATION_VOLUME_DELETE =
lookupActionTypeByLabel("virt.volume_delete");

/**
* The constant representing "Change a virtual network state" [ID:519]
*/
public static final ActionType TYPE_VIRTUALIZATION_NETWORK_STATE_CHANGE =
lookupActionTypeByLabel("virt.network_state");

/**
* The constant representing "Creates a virtual network" [ID:520]
*/
public static final ActionType TYPE_VIRTUALIZATION_NETWORK_CREATE =
lookupActionTypeByLabel("virt.network_create");

/**
* The constant representing "Execute an Ansible playbook" [ID:521]
*/
public static final ActionType TYPE_PLAYBOOK = lookupActionTypeByLabel("ansible.playbook");

/**
* The constant representing "Migrate a virtual domain" [ID:522]
*/
public static final ActionType TYPE_VIRTUALIZATION_GUEST_MIGRATE =
lookupActionTypeByLabel("virt.guest_migrate");

/**
* The constant representing "Confidential Compute Attestation" [ID:523]
*/
Expand Down
Loading

0 comments on commit 2c7ece3

Please sign in to comment.