Skip to content

Commit

Permalink
Merge pull request #353 from kthcloud/fix-broken-create-user-snapshot
Browse files Browse the repository at this point in the history
fix broken create snapshot
  • Loading branch information
saffronjam authored Dec 22, 2023
2 parents faed031 + 5dc2e9c commit 5cfdbcf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions service/vm_service/snapshot_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,14 @@ func (c *Client) CreateSnapshot(vmID string, opts *client.CreateSnapshotOptions)
if !vm.Ready() {
return fmt.Errorf("vm %s not ready", vmID)
}
var params *vmModel.CreateSnapshotParams
params := &vmModel.CreateSnapshotParams{}
if opts.System != nil {
params = opts.System
} else if opts.User != nil {
params.FromDTO(opts.User)
}

if params == nil {
if params.Name == "" {
log.Println("no snapshot type specified when creating snapshot for vm", vmID, ". did you forget to specify the type?")
return nil
}
Expand Down

0 comments on commit 5cfdbcf

Please sign in to comment.