You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by de...@apache.org on 2018/07/05 21:17:22 UTC

[trafficcontrol] branch master updated: add tenant_id with user

This is an automated email from the ASF dual-hosted git repository.

dewrich pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git


The following commit(s) were added to refs/heads/master by this push:
     new 8cc2831  add tenant_id with user
8cc2831 is described below

commit 8cc2831e7b24667d2c936a0aa5a770ec81268a96
Author: Dan Kirkwood <da...@apache.org>
AuthorDate: Thu Jul 5 09:27:48 2018 -0600

    add tenant_id with user
---
 infrastructure/cdn-in-a-box/traffic_ops/adduser.pl | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/infrastructure/cdn-in-a-box/traffic_ops/adduser.pl b/infrastructure/cdn-in-a-box/traffic_ops/adduser.pl
index 91f66c9..0e41b8e 100755
--- a/infrastructure/cdn-in-a-box/traffic_ops/adduser.pl
+++ b/infrastructure/cdn-in-a-box/traffic_ops/adduser.pl
@@ -30,15 +30,17 @@ if ($#ARGV < 2) {
 my $username = shift // 'admin';
 my $password = shift or die "Password is required\n";
 my $role = shift // 'admin';
+my $tenant = shift // 'root';
 
 # Skip the insert if the admin 'username' is already there.
 my $hashed_passwd = hash_pass( $password );
 print <<"ADMIN";
-insert into tm_user (username, role, local_passwd, confirm_local_passwd)
+insert into tm_user (username, role, local_passwd, confirm_local_passwd, tenant_id)
     values  ('$username',
             (select id from role where name = '$role'),
             '$hashed_passwd',
-            '$hashed_passwd' )
+            '$hashed_passwd',
+            (SELECT id FROM tenant WHERE name='$tenant'))
     ON CONFLICT (username) DO NOTHING;
 ADMIN