From d1c5c6178c14fda5ea839904f15459591157bb85 Mon Sep 17 00:00:00 2001 From: Justin C Presley Date: Sat, 24 Jul 2021 21:46:56 -0500 Subject: [PATCH] Number of Copies required to be >2 --- docs/src/specification/client.rst | 2 +- ndn_hydra/client/main.py | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/src/specification/client.rst b/docs/src/specification/client.rst index 3c96fe2..268efb1 100644 --- a/docs/src/specification/client.rst +++ b/docs/src/specification/client.rst @@ -14,7 +14,7 @@ Insertion --------- Inserts a local file given by the path within a hydra repo associated with the following Name. Insertion -requires the number nodes to be ``2xNum_Copies`` and it is advised to have the number of copies at least be 2 +requires the number nodes to be ``2xNum_Copies`` and it is required to have the number of copies at least be 2 so that if one fails, nodes can download the file from the other node that has the file. Assuming this is ran being in the root directory, the following is a template on ways to run diff --git a/ndn_hydra/client/main.py b/ndn_hydra/client/main.py index a0fbb1c..f609ef8 100644 --- a/ndn_hydra/client/main.py +++ b/ndn_hydra/client/main.py @@ -108,8 +108,11 @@ def interpret_help() -> None: # Configure Arguments if vars.function == "insert": if not os.path.isfile(vars.path): - print('Error: path specified is not an actual file. Unable to insert.') - sys.exit() + print('Error: path specified is not an actual file. Unable to insert.') + sys.exit() + if vars.copies < 2: + print('Error: insufficient number of copies, must be 2 or above.') + sys.exit() return vars class HydraClient():