Skip to content

Commit

Permalink
Merge pull request #13206 from hamistao/remove_impossible_condition
Browse files Browse the repository at this point in the history
lxd/api_internal.go: remove impossible conditions
  • Loading branch information
tomponline committed Mar 23, 2024
2 parents fd39352 + cd98516 commit 69d625e
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions lxd/api_internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -885,24 +885,6 @@ func internalImportFromBackup(s *state.State, projectName string, instName strin
return fmt.Errorf(`Storage volume for snapshot %q already exists in the database`, snapInstName)
}

if snapErr == nil {
err := s.DB.Cluster.Transaction(context.TODO(), func(ctx context.Context, tx *db.ClusterTx) error {
return tx.DeleteInstance(ctx, projectName, snapInstName)
})
if err != nil {
return err
}
}

if dbVolume != nil {
err := s.DB.Cluster.Transaction(context.TODO(), func(ctx context.Context, tx *db.ClusterTx) error {
return tx.RemoveStoragePoolVolume(ctx, projectName, snapInstName, instanceDBVolType, pool.ID())
})
if err != nil {
return err
}
}

baseImage := snap.Config["volatile.base_image"]

arch, err := osarch.ArchitectureId(snap.Architecture)
Expand Down

0 comments on commit 69d625e

Please sign in to comment.