mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-26 11:35:10 +00:00
Fix creating channel when ${PWD} contains space.
If the path of the project contains spaces, the "test-network/scripts/envVar.sh" script sets the value of "$ORDERER_CA" to a value containg "${PWD}" which, in turn, contains space(s).
When the variable used in "test-network/scripts/createChannel.sh", The first part of the value (before the first space) is handled as the whole value for "--cafile". Other parts are considered to be part of the command!
I tried putting (escaped) quotes in the "test-network/scripts/envVar.sh" definition for the variable "$ORDERER_CA" to make the fix more general, but the quotation marks were sometime interpreted to be part of the path that consisted of concatenated parts somewhere and it did not work.
While this edit will fix this issue, I belive this is just a work around. I expect that there is a better way to solve the root cause of the problem instead of just fixing it in one place. Moreover, All variables/paths that may include spaces should be properly handled as well.
Thanks
Signed-off-by: Waleed Mortaja <waleedmortaja@protonmail.com>
This commit is contained in:
parent
6fd327a347
commit
9f5a09b673
1 changed files with 1 additions and 1 deletions
|
|
@ -33,7 +33,7 @@ createChannel() {
|
||||||
while [ $rc -ne 0 -a $COUNTER -lt $MAX_RETRY ] ; do
|
while [ $rc -ne 0 -a $COUNTER -lt $MAX_RETRY ] ; do
|
||||||
sleep $DELAY
|
sleep $DELAY
|
||||||
set -x
|
set -x
|
||||||
peer channel create -o localhost:7050 -c $CHANNEL_NAME --ordererTLSHostnameOverride orderer.example.com -f ./channel-artifacts/${CHANNEL_NAME}.tx --outputBlock $BLOCKFILE --tls --cafile $ORDERER_CA >&log.txt
|
peer channel create -o localhost:7050 -c $CHANNEL_NAME --ordererTLSHostnameOverride orderer.example.com -f ./channel-artifacts/${CHANNEL_NAME}.tx --outputBlock $BLOCKFILE --tls --cafile "$ORDERER_CA" >&log.txt
|
||||||
res=$?
|
res=$?
|
||||||
{ set +x; } 2>/dev/null
|
{ set +x; } 2>/dev/null
|
||||||
let rc=$res
|
let rc=$res
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue