Skip to content

Commit

Permalink
fix a file which was forgot to commit
Browse files Browse the repository at this point in the history
  • Loading branch information
h-otter committed Jul 7, 2019
1 parent 568aafc commit 40de396
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions n0core/pkg/api/provisioning/virtualmachine/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"golang.org/x/crypto/ssh"
"google.golang.org/grpc/codes"

"github.com/n0stack/n0stack/n0core/pkg/datastore"
stdapi "github.com/n0stack/n0stack/n0core/pkg/api/standard_api"
"github.com/n0stack/n0stack/n0core/pkg/datastore/lock"
"github.com/n0stack/n0stack/n0core/pkg/driver/cloudinit/configdrive"
"github.com/n0stack/n0stack/n0core/pkg/driver/iproute2"
Expand Down Expand Up @@ -119,7 +119,7 @@ func (a VirtualMachineAgent) BootVirtualMachine(ctx context.Context, req *BootVi
err := func() error {
bn := netutil.StructLinuxNetdevName(nd.NetworkName)
if !lock.WaitUntilLock(a.bridgeMutex, bn, 5*time.Second, 10*time.Millisecond) {
return errors.Wrapf(datastore.LockError(), "Failed to lock bridge '%s'", bn)
return errors.Wrapf(stdapi.LockError(), "Failed to lock bridge '%s'", bn)
}
defer a.bridgeMutex.Unlock(bn)

Expand All @@ -129,7 +129,7 @@ func (a VirtualMachineAgent) BootVirtualMachine(ctx context.Context, req *BootVi
}
tx.PushRollback("delete created bridge", func() error {
if !lock.WaitUntilLock(a.bridgeMutex, b.Name(), 5*time.Second, 10*time.Millisecond) {
return fmt.Errorf("Failed to lock bridge '%s': err='%s'", b.Name(), datastore.LockError().Error())
return fmt.Errorf("Failed to lock bridge '%s': err='%s'", b.Name(), stdapi.LockError().Error())
}
defer a.bridgeMutex.Unlock(b.Name())

Expand Down Expand Up @@ -319,7 +319,7 @@ func (a VirtualMachineAgent) DeleteVirtualMachine(ctx context.Context, req *Dele
err = func() error {
bn := netutil.StructLinuxNetdevName(nd.NetworkName)
if !lock.WaitUntilLock(a.bridgeMutex, bn, 5*time.Second, 10*time.Millisecond) {
return errors.Wrapf(datastore.LockError(), "Failed to lock bridge '%s'", bn)
return errors.Wrapf(stdapi.LockError(), "Failed to lock bridge '%s'", bn)
}
defer a.bridgeMutex.Unlock(bn)

Expand Down

0 comments on commit 40de396

Please sign in to comment.