use of org.ovirt.engine.core.compat.RpmVersion in project ovirt-engine by oVirt.
the class HostMapperTest method testLibvirtVersion.
@Test
public void testLibvirtVersion() {
VDS vds = new VDS();
vds.setId(Guid.Empty);
vds.setLibvirtVersion(new RpmVersion("libvirt-0.9.10-21.el6_3.4", "libvirt-", true));
Host host = HostMapper.map(vds, (Host) null);
assertNotNull(host.getLibvirtVersion());
assertEquals(Long.valueOf(0), Long.valueOf(host.getLibvirtVersion().getMajor()));
assertEquals(Long.valueOf(9), Long.valueOf(host.getLibvirtVersion().getMinor()));
assertEquals(Long.valueOf(0), Long.valueOf(host.getLibvirtVersion().getRevision()));
assertEquals(Long.valueOf(10), Long.valueOf(host.getLibvirtVersion().getBuild()));
assertEquals("libvirt-0.9.10-21.el6_3.4", host.getLibvirtVersion().getFullVersion());
}
use of org.ovirt.engine.core.compat.RpmVersion in project ovirt-engine by oVirt.
the class HostMapperTest method testVersion.
@Test
public void testVersion() {
VDS vds = new VDS();
vds.setId(Guid.Empty);
vds.setVersion(new RpmVersion("vdsm-4.10.0-10.fc17", "vdsm-", true));
Host host = HostMapper.map(vds, (Host) null);
assertNotNull(host.getVersion());
assertEquals(Long.valueOf(4), Long.valueOf(host.getVersion().getMajor()));
assertEquals(Long.valueOf(10), Long.valueOf(host.getVersion().getMinor()));
assertEquals(Long.valueOf(0), Long.valueOf(host.getVersion().getRevision()));
assertEquals(Long.valueOf(0), Long.valueOf(host.getVersion().getBuild()));
assertEquals("vdsm-4.10.0-10.fc17", host.getVersion().getFullVersion());
}
use of org.ovirt.engine.core.compat.RpmVersion in project ovirt-engine by oVirt.
the class UpgradeOvirtNodeInternalCommand method isISOCompatible.
private boolean isISOCompatible(File iso, RpmVersion ovirtHostOsVersion) {
boolean ret = false;
log.debug("Check if ISO compatible: '{}'", iso);
for (OVirtNodeInfo.Entry info : OVirtNodeInfo.getInstance().get()) {
if (info.path.equals(iso.getParentFile())) {
try {
Matcher matcher = info.isoPattern.matcher(iso.getCanonicalFile().getName());
if (matcher.find()) {
String rpmLike = matcher.group(1).replaceAll("-", ".");
log.debug("ISO version: '{}' '{}' '{}'", iso, rpmLike, ovirtHostOsVersion);
RpmVersion isoVersion = new RpmVersion(rpmLike, "", true);
if (VdsHandler.isIsoVersionCompatibleForUpgrade(ovirtHostOsVersion, isoVersion)) {
log.debug("ISO compatible '{}'", iso);
ret = true;
break;
}
}
} catch (IOException e) {
log.error("Cannot get canonical path to '{}': {}", iso.getName(), e.getMessage());
log.debug("Exception", e);
}
}
}
return ret;
}
use of org.ovirt.engine.core.compat.RpmVersion in project ovirt-engine by oVirt.
the class HostInstallPopupView method initEditors.
void initEditors() {
isoEditor = new ListModelListBoxEditor<>(new NullSafeRenderer<RpmVersion>() {
@Override
public String renderNullSafe(RpmVersion version) {
// Format string to contain major.minor version only.
return version.getRpmName();
}
});
// $NON-NLS-1$
rbPassword = new RadioButton("1");
// $NON-NLS-1$
rbPublicKey = new RadioButton("1");
publicKeyEditor = new StringEntityModelTextAreaLabelEditor();
activateHostAfterInstallEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
overrideIpTablesEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
}
use of org.ovirt.engine.core.compat.RpmVersion in project ovirt-engine by oVirt.
the class HandleVdsVersionCommand method executeCommand.
@Override
protected void executeCommand() {
VDS vds = getVds();
Cluster cluster = getCluster();
boolean isEngineSupportedByVdsm = false;
// partialVdcVersion will hold the engine's version (minor and major parts),
// this will be compared to vdsm supported engines to see if vdsm can be added
// to cluster
Version partialVdcVersion = new Version(new Version(Config.getValue(ConfigValues.VdcVersion)).toString(2));
RpmVersion vdsVersion = vds.getVersion();
Version vdsmVersion = new Version(vdsVersion.getMajor(), vdsVersion.getMinor());
if (!StringUtils.isEmpty(vds.getSupportedEngines())) {
isEngineSupportedByVdsm = vds.getSupportedENGINESVersionsSet().contains(partialVdcVersion);
}
// and cluster supports the specific vdsm version. which is sufficient
if (!isEngineSupportedByVdsm && !Config.<HashSet<Version>>getValue(ConfigValues.SupportedVDSMVersions).contains(vdsmVersion)) {
reportNonOperationReason(NonOperationalReason.VERSION_INCOMPATIBLE_WITH_CLUSTER, Config.<HashSet<Version>>getValue(ConfigValues.SupportedVDSMVersions).toString(), vdsmVersion.toString());
} else if (!VersionSupport.checkClusterVersionSupported(cluster.getCompatibilityVersion(), vds)) {
reportNonOperationReason(NonOperationalReason.CLUSTER_VERSION_INCOMPATIBLE_WITH_CLUSTER, cluster.getCompatibilityVersion().toString(), vds.getSupportedClusterLevels());
} else {
checkClusterAdditionalFeaturesSupported(cluster, vds);
}
setSucceeded(true);
}
Aggregations