use of com.iwave.ext.linux.model.MultiPathEntry in project coprhd-controller by CoprHD.
the class ListMultiPathEntriesCommand method parseOutput.
@Override
public void parseOutput() {
results = Lists.newArrayList();
if (getOutput() != null && getOutput().getStdout() != null) {
String stdout = getOutput().getStdout();
TextParser parser = new TextParser();
parser.setRepeatPattern(ENTRY_PATTERN);
for (String textBlock : parser.parseTextBlocks(stdout)) {
MultiPathEntry entry = readEntry(textBlock);
if (entry != null) {
results.add(entry);
}
}
}
}
use of com.iwave.ext.linux.model.MultiPathEntry in project coprhd-controller by CoprHD.
the class LinuxSupport method getParentMultipathDevice.
protected String getParentMultipathDevice(String device) {
String parentDeviceDmName = execute(new GetMultipathPrimaryPartitionDeviceParentDmName(device));
MultiPathEntry multipathEntry = execute(new FindMultiPathEntryForDmName(parentDeviceDmName));
return StringUtils.substringBeforeLast(device, "/") + "/" + multipathEntry.getName();
}
use of com.iwave.ext.linux.model.MultiPathEntry in project coprhd-controller by CoprHD.
the class LinuxSupport method findMultipathEntries.
public void findMultipathEntries(List<VolumeSpec> volumes) {
for (VolumeSpec volume : volumes) {
MultiPathEntry device = execute(new FindMultiPathEntryForVolume(volume.viprVolume));
volume.multipathEntries = Lists.newArrayList(device);
}
}
use of com.iwave.ext.linux.model.MultiPathEntry in project coprhd-controller by CoprHD.
the class FindMultiPathEntriesForMountPoint method executeTask.
@Override
public Void executeTask() throws Exception {
List<MultiPathEntry> allMultiPathEntries = executeCommand(new ListMultiPathEntriesCommand(), SHORT_TIMEOUT);
for (VolumeSpec volume : volumes) {
volume.multipathEntries = Lists.newArrayList();
String device = volume.mountPoint.getDevice();
if (StringUtils.startsWith(device, "/dev/mapper/")) {
String deviceName = StringUtils.substringAfterLast(device, "/");
for (MultiPathEntry entry : allMultiPathEntries) {
if (StringUtils.equals(deviceName, entry.getName())) {
volume.multipathEntries.add(entry);
break;
}
}
}
if (volume.multipathEntries.size() == 0) {
warn("FindMultiPathEntriesForMountPoint.noMultipathEntries", volume.mountPoint.getPath());
}
}
return null;
}
use of com.iwave.ext.linux.model.MultiPathEntry in project coprhd-controller by CoprHD.
the class FindMultiPathEntryForDmName method findMultiPathEntry.
protected MultiPathEntry findMultiPathEntry(String dmName, List<MultiPathEntry> multipathEntries) {
for (MultiPathEntry entry : multipathEntries) {
String entryDmName = entry.getDmName();
logDebug("FindMultiPathEntryForDmName.log.checking", entry.getName(), entry.getDmName(), dmName);
if (StringUtils.equalsIgnoreCase(entryDmName, dmName)) {
return entry;
}
}
return null;
}
Aggregations