rc: Add mount to list if mount point was successfully created
This commit is contained in:
parent
d6a9017298
commit
68afa28b27
1 changed files with 6 additions and 4 deletions
|
@ -93,16 +93,18 @@ func mountRc(_ context.Context, in rc.Params) (out rc.Params, err error) {
|
||||||
if mountFns[mountType] != nil {
|
if mountFns[mountType] != nil {
|
||||||
_, _, unmountFn, err := mountFns[mountType](fdst, mountPoint)
|
_, _, unmountFn, err := mountFns[mountType](fdst, mountPoint)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
log.Printf("mount FAILED: %v", err)
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
// Add mount to list if mount point was successfully created
|
||||||
liveMounts[mountPoint] = MountInfo{
|
liveMounts[mountPoint] = MountInfo{
|
||||||
unmountFn: unmountFn,
|
unmountFn: unmountFn,
|
||||||
MountedOn: time.Now(),
|
MountedOn: time.Now(),
|
||||||
Fs: fdst.Name(),
|
Fs: fdst.Name(),
|
||||||
MountPoint: mountPoint,
|
MountPoint: mountPoint,
|
||||||
}
|
}
|
||||||
if err != nil {
|
|
||||||
log.Printf("mount FAILED: %v", err)
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
fs.Debugf(nil, "Mount for %s created at %s using %s", fdst.String(), mountPoint, mountType)
|
fs.Debugf(nil, "Mount for %s created at %s using %s", fdst.String(), mountPoint, mountType)
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue