Skip to content

Commit

Permalink
[FAB-10170] Check mspMgrConfigDir is Dir
Browse files Browse the repository at this point in the history
This tries to check whether mspMgrConfigDir is a Dir instead
of just existing.

Change-Id: Ifb9f52e7d88c5f2b74e4c47390bc71116f6db61e
Signed-off-by: Zhenguo Niu <Niu.ZGlinux@gmail.com>
  • Loading branch information
niuzhenguo authored and mastersingh24 committed May 19, 2018
1 parent 71983e8 commit 6db89d7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions peer/common/common.go
Original file line number Diff line number Diff line change
@@ -100,8 +100,8 @@ func InitConfig(cmdRoot string) error {
func InitCrypto(mspMgrConfigDir, localMSPID, localMSPType string) error {
var err error
// Check whether msp folder exists
_, err = os.Stat(mspMgrConfigDir)
if os.IsNotExist(err) {
fi, err := os.Stat(mspMgrConfigDir)
if os.IsNotExist(err) || !fi.IsDir() {
// No need to try to load MSP from folder which is not available
return errors.Errorf("cannot init crypto, missing %s folder", mspMgrConfigDir)
}

0 comments on commit 6db89d7

Please sign in to comment.