Resource name not checked on command line?

4 posts / 0 new
Last post
Resource name not checked on command line?

Shava asked:

I also asked Christopher to specifically test a bad resource name since neither of them verified that scenario — do you know if your code detects that?  Sometimes admins enter the wrong resource name so I wanted that tested specifically.

The API uses the API_ID and API_KEY to verify that it is a valid copy of xdusage talking to it.
In production, the API_ID and the resource name specified in the configuration file would be the same. In testing, a different, unique API_ID would be used.

In either case, a different resource name can be specified from the command line to change what machine data is being queried for. I do have a new function check_resource() that I use to check the resource name specified in the configuration file. I did not add any checks to the user information specified on the command line although thinking about it now I should have. It would be very easy to add this check for a resource name specified as a command line argument.

 

Delivery Effort Stage: 

Hi Peter,

I asked Christopher to test this and he found the admin side worked good but the user does not see any error.  Is there something simple you could add to let the user know there is a misconfiguration of xdusage rather than just empty data?

root@racd etc]# grep resource /etc/xdusage.conf

resource_name     = xxx.xxx.xsede

As root:

[root@racd etc]# xdusage 

You are running this script as root.

As an administrator, you will be given directions to set up xdusage to run on this machine, if needed.

Where possible, you will also be given instructions to correct any errors that are detected.

The resource_name 'xxx.xxx.xsede' specified in the configuration file '/etc/xdusage.conf'

is not listed as a current XSEDE system.

Information may not exist in the XSEDE central accounting database for this resource.

Current XSEDE resources are listed at:

https://info1.dyn.xsede.org/wh1/warehouse-views/v1/resources-xdcdb-active/

xdusage: No projects and/or accounts found

As non-root user (but an admin user)

[cirving@racd bin]$ xdusage 

xdusage: No projects and/or accounts found

Thanks,
Shava

Hi Peter,

I asked Christopher to test this and he found the admin side worked good but the user does not see any error.  Is there something simple you could add to let the user know there is a misconfiguration of xdusage rather than just empty data?

root@racd etc]# grep resource /etc/xdusage.conf

resource_name     = xxx.xxx.xsede

As root:

[root@racd etc]# xdusage 

You are running this script as root.

As an administrator, you will be given directions to set up xdusage to run on this machine, if needed.

Where possible, you will also be given instructions to correct any errors that are detected.

The resource_name 'xxx.xxx.xsede' specified in the configuration file '/etc/xdusage.conf'

is not listed as a current XSEDE system.

Information may not exist in the XSEDE central accounting database for this resource.

Current XSEDE resources are listed at:

https://info1.dyn.xsede.org/wh1/warehouse-views/v1/resources-xdcdb-active/

xdusage: No projects and/or accounts found

As non-root user (but an admin user)

[cirving@racd bin]$ xdusage 

xdusage: No projects and/or accounts found

Thanks,
Shava

The user will now get a similar message when the configuration file contains an unrecognized resource. They are told to tell their administrator about it and that they can specify another resource by using the "-r" option.

Log in to post comments