mirror of https://github.com/nucypher/nucypher.git
Allow for empty, pre-existing configuration root directory.
parent
41bb7dae34
commit
bf114cafd1
|
@ -496,8 +496,10 @@ class NodeConfiguration(ABC):
|
||||||
try:
|
try:
|
||||||
os.mkdir(self.config_root, mode=0o755)
|
os.mkdir(self.config_root, mode=0o755)
|
||||||
except FileExistsError:
|
except FileExistsError:
|
||||||
message = "There are existing configuration files at {}".format(self.config_root)
|
# Check for existing files
|
||||||
raise self.ConfigurationError(message)
|
if os.listdir(self.config_root):
|
||||||
|
message = "There are existing files located at {}".format(self.config_root)
|
||||||
|
raise self.ConfigurationError(message)
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
message = "Cannot write configuration files because the directory {} does not exist."
|
message = "Cannot write configuration files because the directory {} does not exist."
|
||||||
raise self.ConfigurationError(message)
|
raise self.ConfigurationError(message)
|
||||||
|
|
Loading…
Reference in New Issue