[lxc-devel] [lxd/master] main/daemon: Fixes test runner by allowing empty command arg

tomponline on Github lxc-bot at linuxcontainers.org
Tue Jun 25 09:11:38 UTC 2019


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 361 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20190625/17bcb2e8/attachment.bin>
-------------- next part --------------
From 35fba92bb40ebc0482ee2d7bb042a95f8b8081ef Mon Sep 17 00:00:00 2001
From: Thomas Parrott <thomas.parrott at canonical.com>
Date: Tue, 25 Jun 2019 10:11:06 +0100
Subject: [PATCH] main/daemon: Fixes test runner by allowing empty command arg

Signed-off-by: Thomas Parrott <thomas.parrott at canonical.com>
---
 lxd/main_daemon.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lxd/main_daemon.go b/lxd/main_daemon.go
index aa1fd75ecc..68a878cb96 100644
--- a/lxd/main_daemon.go
+++ b/lxd/main_daemon.go
@@ -40,7 +40,7 @@ func (c *cmdDaemon) Command() *cobra.Command {
 }
 
 func (c *cmdDaemon) Run(cmd *cobra.Command, args []string) error {
-	if len(args) > 1 || (len(args) == 1 && args[0] != "daemon") {
+	if len(args) > 1 || (len(args) == 1 && args[0] != "daemon" && args[0] != "") {
 		return fmt.Errorf("unknown command \"%s\" for \"%s\"", args[0], cmd.CommandPath())
 	}
 


More information about the lxc-devel mailing list