Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In order to use the software add the directory to the front of your PATH and PYTHONPATH environment variables.

Return codes

All of these commands yield a return code of zero upon successful termination and yield a non-zero code upon failure.

Confluence login

Most of these scripts will prompt you for your Confluence password so that they can log in to Confluence. Some scripts will take a login token on the command line instead; run hwdblogin.py to get a token. Each such token is good for 60 minutes but will also expire if not used for anything for 20 minutes.

All commands will Commands will that ask for a password log you in to Confluence just once and will terminate when the login expires. Commands that take a login token will fail if the token is illegal or has expired.

There are several different types of authentication failures that you may see:


Error code 253
Unable to log in to server: https://confluence.slac.stanford.edu/rpc/soap-axis/confluenceservice-v1 with user: <username>.
Cause: com.atlassian.confluence.rpc.AuthenticationFailedException: Attempt to log in user '<username>' failed - incorrect username/password combination.

You used the wrong user name or password. This increments the failed login count for the account, assuming that the user name is actually a valid one.


Error code 253
Remote error: com.atlassian.confluence.rpc.InvalidSessionException: User not authenticated or session expired. Call login() to open a new session.

This is what you'll see when you try to use an illegal or expired token.

 

Error code 253
Unable to log in to server: https://confluence.slac.stanford.edu/rpc/soap-axis/confluenceservice-v1 with user: <username>.
Cause: com.atlassian.confluence.rpc.AuthenticationFailedException: Attempt to log in user '<username>' failed. The maximum \
number of failed login attempts has been reached. Please log into the web application through the web interface to reset the nu\
mber of failed login attempts.

Confluence allows five consecutive login failures for a given account. After that you'll be required to log in to that account via the web interface and type in a CAPTCHA phrase in order to prove that you're not a robot.

 

Creating blank pages: makeblanks.py

...


Allocating a MAC address: allocmac.py

The page "HWDB MAC address pool" file "macfile" in the same directory as this software shows which of the DAT group's MAC address have been allocated and which are still free. allocmac.py reads the pagefile, allocates one MAC address, updates the page and prints the allocated address on stdout. This command requires a token generated by hwdblogin.pyFor testing purposes allocmac.py can take an option --macfile which specifies a MAC address file different from the default.

bash-3.2$ mac=$(allocmac.py --loginmacfile $tokenmymacs)
bash-3.2$ echo $mac
08:00:56:00:43:38

The MAC file read by allocmac.py must consist of exactly three lines. The first line contains the first address in the block assigned to the DAT group (or your test block). The second line contains the first free address. The third line contains the last address in the assigned block. For example:

08:00:56:00:40:00
08:00:56:00:43:31
08:00:56:00:7f:ff

Checking pages for validity: checkpage.py

...

bash-3.2$ checkpage.py
Check device pages in the hardware database in Confluence.
Type control-D or control-C at a prompt to terminate.

Confluence password for tether:

Enter page ID (or URL from sticker with Page ID in it): 165089846               
Title is 'HWDB 165089846'.
OK

Enter page ID or URL from sticker: https://confluence.slac.stanford.edu/pages/viewpage.action?pageId=165089846
Title is 'HWDB 165089846'.
OK

Enter page ID or URL from sticker: ^D

...

Although you can edit a device page in the hardware database just as you can any other Confluence page, you may find it more convenient to use initpage.py. This command repeatedly prompts for a page ID or sticker URL. It checks whether the Type and Serial fields are present and valid, prompting for the value of any missing or invalid field. You can enter a null value for the serial number if you don't know it yet. The page is updated accordingly. You're then asked to where you want to move the page.

...

Confluence password for tether:
 
Enter page ID (or URL from stickerwith Page ID in it): 165089846
Type field is missing or blank.

...