HDDS-1680. Create missing parent directories during the creation of HddsVolume dirs (#961)
This commit is contained in:
parent
89acbbc0b9
commit
e094b3b4cd
@ -204,7 +204,7 @@ private void initialize() throws IOException {
|
||||
switch (intialVolumeState) {
|
||||
case NON_EXISTENT:
|
||||
// Root directory does not exist. Create it.
|
||||
if (!hddsRootDir.mkdir()) {
|
||||
if (!hddsRootDir.mkdirs()) {
|
||||
throw new IOException("Cannot create directory " + hddsRootDir);
|
||||
}
|
||||
setState(VolumeState.NOT_FORMATTED);
|
||||
|
@ -230,7 +230,7 @@ public void testFailVolumes() throws Exception{
|
||||
ozoneConfig.set(HDDS_DATANODE_DIR_KEY, readOnlyVolumePath.getAbsolutePath()
|
||||
+ "," + volumePath.getAbsolutePath());
|
||||
volSet = new VolumeSet(UUID.randomUUID().toString(), ozoneConfig);
|
||||
assertTrue(volSet.getFailedVolumesList().size() == 1);
|
||||
assertEquals(1, volSet.getFailedVolumesList().size());
|
||||
assertEquals(readOnlyVolumePath, volSet.getFailedVolumesList().get(0)
|
||||
.getHddsRootDir());
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user