Versions Compared

Key

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

...


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.

...