rdb util: AttachDisk: Skip unnecessary call for waitforpath
Skip unnecessary call to waitforpath if found = true during the first call.
This commit is contained in:
		@@ -237,7 +237,6 @@ func (util *RBDUtil) AttachDisk(b rbdBuilder) error {
 | 
				
			|||||||
				break
 | 
									break
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
		if err != nil {
 | 
							if err != nil {
 | 
				
			||||||
			return err
 | 
								return err
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
@@ -245,6 +244,7 @@ func (util *RBDUtil) AttachDisk(b rbdBuilder) error {
 | 
				
			|||||||
		if !found {
 | 
							if !found {
 | 
				
			||||||
			return errors.New("Could not map image: Timeout after 10s")
 | 
								return errors.New("Could not map image: Timeout after 10s")
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	// mount it
 | 
						// mount it
 | 
				
			||||||
	globalPDPath := b.manager.MakeGlobalPDName(*b.rbd)
 | 
						globalPDPath := b.manager.MakeGlobalPDName(*b.rbd)
 | 
				
			||||||
	notMnt, err := b.mounter.IsLikelyNotMountPoint(globalPDPath)
 | 
						notMnt, err := b.mounter.IsLikelyNotMountPoint(globalPDPath)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user