Skip to content

Commit

Permalink
Handling special IP address names
Browse files Browse the repository at this point in the history
  • Loading branch information
ElNounch committed Feb 21, 2016
1 parent d2efb2b commit 0e0dbb7
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions pkg/commands/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,22 @@ func RunCreate(ctx CommandContext, args CreateArgs) error {

env := strings.Join(args.Tags, " ")
volume := strings.Join(args.Volumes, " ")
serverID, err := api.CreateServer(ctx.API, &api.ConfigCreateServer{
config := api.ConfigCreateServer{
ImageName: args.Image,
Name: args.Name,
Bootscript: args.Bootscript,
Env: env,
AdditionalVolumes: volume,
DynamicIPRequired: args.IP == "",
DynamicIPRequired: false,
IP: args.IP,
})
}
if args.IP == "" || args.IP == "dynamic" {
config.DynamicIPRequired = true
config.IP = ""
} else if args.IP == "none" || args.IP == "no" {
config.IP = ""
}
serverID, err := api.CreateServer(ctx.API, &config)
if err != nil {
return err
}
Expand Down

0 comments on commit 0e0dbb7

Please sign in to comment.