can't delete afanasy user with afcmd udel command

Customize rules.
Post Reply
c.r.m
Posts: 4
Joined: Tue Jul 23, 2019 5:38 am

can't delete afanasy user with afcmd udel command

Post by c.r.m » Tue Jul 23, 2019 5:46 am

I created a new user. When I want to delete this user again the message shows "Action processed." but the user wasn't removed. Has this something to do with permissions or do I have to create a new ubuntu user with same name to be able to delete afanasy users?

Code: Select all

$ afcmd uadd newuser
Config file does not exist:
/opt/cgru/config.json
{"user":
{
"name":"newuser",
"id":5,
"priority":99,
"solve_method":"solve_order",
"solve_need":"solve_capacity",
"time_register":1563859411,
"time_activity":1563859411,
"errors_retries":3,
"errors_avoid_host":3,
"errors_task_same_host":3,
"errors_forgive_time":18000
}
}

Code: Select all

$ afcmd udel newuser
Config file does not exist:
/opt/cgru/config.json
{"info":{"kind":"log","text":"Action processed."}}

User avatar
timurhai
Site Admin
Posts: 512
Joined: Sun Jan 15, 2017 8:40 pm
Location: Russia, Korolev
Contact:

Re: can't delete afanasy user with afcmd udel command

Post by timurhai » Tue Jul 23, 2019 10:18 am

Hi.
Just now have repeated the same situation.
It seems that there is a bug.
I was able do delete user from afwatch.
Strange, but it uses the same JSON protocol (API).
So, probably that the bug is in afcmd.
I will look at it.

btw,
You can use JSON protocol directly w/o CLI (afcmd) or GUI (afwatch\WEB).
Timur Hairulin
CGRU 2.4.0, Ubuntu 18.04 LTS, MS Windows 10 (clients only).

c.r.m
Posts: 4
Joined: Tue Jul 23, 2019 5:38 am

Re: can't delete afanasy user with afcmd udel command

Post by c.r.m » Thu Jul 25, 2019 9:25 am

btw,
You can use JSON protocol directly w/o CLI (afcmd) or GUI (afwatch\WEB).
How to use json protocol directly?

Would this be correct json call?

Code: Select all

{
 "delete":
 {
  "type" : "users",
  "name" : "username"
 }
}

User avatar
timurhai
Site Admin
Posts: 512
Joined: Sun Jan 15, 2017 8:40 pm
Location: Russia, Korolev
Contact:

Re: can't delete afanasy user with afcmd udel command

Post by timurhai » Mon Jul 29, 2019 2:24 pm

Hi.
Bug was fixed:
https://github.com/CGRU/cgru/commit/2d8 ... 23cd0ce7dc

Later afcmd udel set permanent to false. User became temporal. Server deletes temporal users with no jobs.
This was long ago, now there are no permanent/temporal users (server does not delete users no more in any case).

If you want to see JSON data that afcmd sends, apply this commit:
https://github.com/CGRU/cgru/commit/151 ... d65a6347ee

It will be something like:

Code: Select all

{"action":{
"user_name":"timurhai",
"host_name":"hotgirl",
"type":"users",
"mask":"_test_",
"operation":{
"type":"delete"
}
}}
Also you can run afwatch in a console (on Linux only), perform some action and see data it sends to server.
Timur Hairulin
CGRU 2.4.0, Ubuntu 18.04 LTS, MS Windows 10 (clients only).

c.r.m
Posts: 4
Joined: Tue Jul 23, 2019 5:38 am

Re: can't delete afanasy user with afcmd udel command

Post by c.r.m » Thu Aug 01, 2019 6:07 pm

Thank you a lot. All is clear now.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest