[PATCH] tests/samba-tool/user.py: replace deprecated 'add' subcommand with 'create'

Jeremy Allison jra at samba.org
Mon Aug 29 23:58:14 UTC 2016


On Sun, Aug 28, 2016 at 09:39:54AM +0100, Rowland Penny wrote:
> 
> Hi, the test for samba-tool user is still using the deprecated 'add',
> this patch replaces 'add' with 'create'

LGTM. Will push on next autobuild. Thanks !

> From ec130d6b66efcda8585191461923ad94e4295691 Mon Sep 17 00:00:00 2001
> From: Rowland Penny <rpenny at samba.org>
> Date: Sun, 28 Aug 2016 09:29:33 +0100
> Subject: [PATCH] tests/samba-tool/user.py: replace deprecated 'add' subcommand
>  with 'create'
> 
> Signed-off-by: Rowland Penny <rpenny at samba.org>
> ---
>  python/samba/tests/samba_tool/user.py | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/python/samba/tests/samba_tool/user.py b/python/samba/tests/samba_tool/user.py
> index d2eb0e6..10e4f6c 100644
> --- a/python/samba/tests/samba_tool/user.py
> +++ b/python/samba/tests/samba_tool/user.py
> @@ -82,7 +82,7 @@ class UserCmdTestCase(SambaToolCmdTest):
>  
>          # test adding users with --use-username-as-cn
>          for user in self.users:
> -            (result, out, err) =  self.runsubcmd("user", "add", user["name"], user["password"],
> +            (result, out, err) =  self.runsubcmd("user", "create", user["name"], user["password"],
>                                                   "--use-username-as-cn",
>                                                   "--surname=%s" % user["surname"],
>                                                   "--given-name=%s" % user["given-name"],
> @@ -382,7 +382,7 @@ class UserCmdTestCase(SambaToolCmdTest):
>              return
>  
>  
> -# samba-tool user add command didn't support users with empty gecos if none is
> +# samba-tool user create command didn't support users with empty gecos if none is
>  # specified on the command line and the user hasn't one in the passwd file it
>  # will fail, so let's add some contents
>  
> @@ -398,7 +398,7 @@ class UserCmdTestCase(SambaToolCmdTest):
>                          "loginShell": u[6],
>                          })
>          # check if --rfc2307-from-nss sets the same values as we got from pwd.getpwuid()
> -        (result, out, err) = self.runsubcmd("user", "add", user["name"], user["password"],
> +        (result, out, err) = self.runsubcmd("user", "create", user["name"], user["password"],
>                                                  "--surname=%s" % user["surname"],
>                                                  "--given-name=%s" % user["given-name"],
>                                                  "--job-title=%s" % user["job-title"],
> @@ -423,7 +423,7 @@ class UserCmdTestCase(SambaToolCmdTest):
>          user = self._randomPosixUser({"name": u[0]})
>          # create a user with posix attributes from nss but override all of them with the
>          # random ones just obtained
> -        (result, out, err) = self.runsubcmd("user", "add", user["name"], user["password"],
> +        (result, out, err) = self.runsubcmd("user", "create", user["name"], user["password"],
>                                                  "--surname=%s" % user["surname"],
>                                                  "--given-name=%s" % user["given-name"],
>                                                  "--job-title=%s" % user["job-title"],
> @@ -503,7 +503,7 @@ class UserCmdTestCase(SambaToolCmdTest):
>          self._check_user(user)
>  
>      def _create_user(self, user):
> -        return self.runsubcmd("user", "add", user["name"], user["password"],
> +        return self.runsubcmd("user", "create", user["name"], user["password"],
>                                                  "--surname=%s" % user["surname"],
>                                                  "--given-name=%s" % user["given-name"],
>                                                  "--job-title=%s" % user["job-title"],
> -- 
> 2.1.4
> 




More information about the samba-technical mailing list