use of org.ovirt.engine.core.common.businessentities.storage.LibvirtSecret in project ovirt-engine by oVirt.
the class CINDERStorageHelper method runConnectionStorageToDomain.
@Override
protected Pair<Boolean, EngineFault> runConnectionStorageToDomain(StorageDomain storageDomain, Guid vdsId, int type) {
Provider<?> provider = providerDao.get(Guid.createGuidFromString(storageDomain.getStorage()));
List<LibvirtSecret> libvirtSecrets = libvirtSecretDao.getAllByProviderId(provider.getId());
VDS vds = vdsDao.get(vdsId);
if (!isLibrbdAvailable(vds)) {
log.error("Couldn't found librbd1 package on vds {} (needed for storage domain {}).", vds.getName(), storageDomain.getName());
addMessageToAuditLog(AuditLogType.NO_LIBRBD_PACKAGE_AVAILABLE_ON_VDS, null, vds);
return new Pair<>(false, null);
}
return registerLibvirtSecrets(storageDomain, vds, libvirtSecrets);
}
use of org.ovirt.engine.core.common.businessentities.storage.LibvirtSecret in project ovirt-engine by oVirt.
the class BackendOpenStackVolumeAuthenticationKeyResourceTest method getEntity.
@Override
protected LibvirtSecret getEntity(int index) {
LibvirtSecret libvirtSecret = mock(LibvirtSecret.class);
when(libvirtSecret.getId()).thenReturn(GUIDS[index]);
when(libvirtSecret.getDescription()).thenReturn(DESCRIPTIONS[index]);
when(libvirtSecret.getProviderId()).thenReturn(GUIDS[0]);
when(libvirtSecret.getUsageType()).thenReturn(LibvirtSecretUsageType.CEPH);
return libvirtSecret;
}
use of org.ovirt.engine.core.common.businessentities.storage.LibvirtSecret in project ovirt-engine by oVirt.
the class LibvirtSecretModel method flush.
private void flush() {
LibvirtSecret secret = isNew() ? new LibvirtSecret() : getEntity();
secret.setUsageType(getUsageType().getSelectedItem());
secret.setDescription(getDescription().getEntity());
secret.setProviderId(Guid.createGuidFromString(getProviderId().getEntity()));
secret.setId(Guid.createGuidFromString(uuid.getEntity()));
if (StringHelper.isNotNullOrEmpty(getValue().getEntity())) {
secret.setValue(getValue().getEntity());
}
setEntity(secret);
}
use of org.ovirt.engine.core.common.businessentities.storage.LibvirtSecret in project ovirt-engine by oVirt.
the class ProviderSecretListModel method removeSecret.
private void removeSecret() {
if (getWindow() != null) {
return;
}
ConfirmationModel model = new ConfirmationModel();
// $NON-NLS-1$
addDialogCommands(model, this, "OnRemove");
setConfirmWindow(model);
model.setTitle(ConstantsManager.getInstance().getConstants().removeSecretTitle());
model.setHelpTag(HelpTag.remove_secret);
// $NON-NLS-1$
model.setHashName("remove_secret");
ArrayList<String> secretsToRemove = new ArrayList<>();
for (LibvirtSecret libvirtSecret : getSelectedItems()) {
secretsToRemove.add(libvirtSecret.getId().toString());
}
model.setItems(secretsToRemove);
}
Aggregations