diff --git a/client.go b/client.go index 171426e51b54..51449b8a0591 100644 --- a/client.go +++ b/client.go @@ -1041,6 +1041,10 @@ func (c *Client) Init(name string, imgremote string, image string, profiles *[]s source := shared.Jmap{"type": "image"} + if image == "" { + return nil, fmt.Errorf(gettext.Gettext("You must provide an image hash or alias name.")) + } + if imgremote != c.name { source["type"] = "image" source["mode"] = "pull" diff --git a/lxd/daemon.go b/lxd/daemon.go index f5825e7fc171..b9b281a7ad3a 100644 --- a/lxd/daemon.go +++ b/lxd/daemon.go @@ -961,6 +961,11 @@ func (d *Daemon) PasswordCheck(password string) bool { return false } + // No password set + if value == "" { + return false + } + buff, err := hex.DecodeString(value) if err != nil { shared.Log.Error("hex decode failed", log.Ctx{"err": err}) diff --git a/po/lxd.pot b/po/lxd.pot index fb1cd6c9602f..818075941473 100644 --- a/po/lxd.pot +++ b/po/lxd.pot @@ -7,7 +7,7 @@ msgid "" msgstr "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" - "POT-Creation-Date: 2015-09-04 18:08-0400\n" + "POT-Creation-Date: 2015-09-05 21:08-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -97,7 +97,7 @@ msgstr "" msgid "Bad image property: %s\n" msgstr "" -#: client.go:1656 +#: client.go:1660 msgid "Cannot change profile name" msgstr "" @@ -183,7 +183,7 @@ msgstr "" msgid "Ephemeral container" msgstr "" -#: client.go:593 client.go:603 client.go:850 client.go:1877 +#: client.go:593 client.go:603 client.go:850 client.go:1881 #, c-format msgid "Error adding alias %s\n" msgstr "" @@ -622,7 +622,7 @@ msgstr "" msgid "Stopping container failed!" msgstr "" -#: client.go:1063 client.go:1101 +#: client.go:1067 client.go:1105 msgid "The image architecture is incompatible with the target server" msgstr "" @@ -687,6 +687,10 @@ msgstr "" msgid "YAML parse error %v\n" msgstr "" +#: client.go:1045 +msgid "You must provide an image hash or alias name." +msgstr "" + #: client.go:482 msgid "api version mismatch: mine: %q, daemon: %q" msgstr "" @@ -695,7 +699,7 @@ msgstr "" msgid "bad number of things scanned from image, container or snapshot" msgstr "" -#: client.go:1687 +#: client.go:1691 #, c-format msgid "bad profile url %s" msgstr "" @@ -704,7 +708,7 @@ msgstr "" msgid "bad result type from action" msgstr "" -#: client.go:1691 +#: client.go:1695 msgid "bad version in profile url" msgstr "" @@ -712,7 +716,7 @@ msgstr "" msgid "can't copy to the same container name" msgstr "" -#: client.go:1097 +#: client.go:1101 #, c-format msgid "can't get info for image '%s': %s" msgstr "" @@ -721,7 +725,7 @@ msgstr "" msgid "cannot resolve unix socket address: %v" msgstr "" -#: client.go:1740 client.go:1797 +#: client.go:1744 client.go:1801 msgid "device already exists\n" msgstr "" @@ -748,7 +752,7 @@ msgstr "" msgid "expected error, got %s" msgstr "" -#: client.go:1301 +#: client.go:1305 #, c-format msgid "got bad op status %s" msgstr "" @@ -767,7 +771,7 @@ msgstr "" msgid "invalid argument %s" msgstr "" -#: client.go:1464 +#: client.go:1468 #, c-format msgid "invalid wait url %s" msgstr "" @@ -776,7 +780,7 @@ msgstr "" msgid "no response!" msgstr "" -#: client.go:1733 client.go:1790 +#: client.go:1737 client.go:1794 msgid "no value found in %q\n" msgstr ""