You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »

Location

SVN: tool/hwdb/src/linux/ (TBD)

Public installation: /afs/slac/g/cci/hwdb

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

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.

Creating blank pages: blanks.py

Blank pages are all children of the page "Unused HWDB pages" and have titles of the form "Unused HWDB page n" where n is a positive integer. To add more pages and get their URLs for the QR code stickers run blanks.py. It will prompt you for the number of new pages to create and a starting value for n. You should choose values so as to avoid generating the same titles as existing blank pages. blanks.py will print the URLs of the newly created pages. Save these so that stickers may be printed from them.

bash-3.2$ blanks.py
Starting number: 11
Number of new pages: 10
Confluence password:
New page URLS:
https://confluence.slac.stanford.edu/pages/viewpage.action?pageId=165088610
https://confluence.slac.stanford.edu/pages/viewpage.action?pageId=165088611
https://confluence.slac.stanford.edu/pages/viewpage.action?pageId=165088612
https://confluence.slac.stanford.edu/pages/viewpage.action?pageId=165088613
https://confluence.slac.stanford.edu/pages/viewpage.action?pageId=165088614
https://confluence.slac.stanford.edu/pages/viewpage.action?pageId=165088615
https://confluence.slac.stanford.edu/pages/viewpage.action?pageId=165088617
https://confluence.slac.stanford.edu/pages/viewpage.action?pageId=165088618
https://confluence.slac.stanford.edu/pages/viewpage.action?pageId=165088619
https://confluence.slac.stanford.edu/pages/viewpage.action?pageId=165088620

Getting a login token: hwdblogin.py

Some commands can't prompt for a Confluence password because they have to be non-interactive. For such commands you need to obtain a login token by running hwdblogin.py. It will prompt for a password, log in to Confluence and print the resulting token on stdout. You'll need to capture the token for later use.

bash-3.2$ token=$(hwdblogin.py)
Confluence password for tether:
bash-3.2$ echo $token
49eb5131ce


Allocating a MAC address: allocmac.py

The page "HWDB MAC address pool" shows which of the DAT group's MAC address have been allocated and which are still free. allocmac.py reads the page, allocates one MAC address, updates the page and prints the allocated address on stdout. This command requires a token generated by hwdblogin.py.

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

Checking pages for validity: checkpage.py

This command prompts repeatedly for page identifiers. These may be URLs of the page ID form used for the QR code stickers or just the page IDs themselves. checkpage.py performs the following checks on each page:

  • The title is a valid serial number followed by a valid device class.
  • No other page in the hardware database has the same serial number.
  • The Type field is present and valid for the device class.
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: https://confluence.slac.stanford.edu/pages/editpage.action?pageId=163485572
Title is 'da0000007ed19970 DPM'.
OK

Enter page ID or URL from sticker: 163485572
Title is 'da0000007ed19970 DPM'.
OK

Enter page ID or URL from sticker: 163479665
Title is 'Site SLAC Lab 1'.
The title has more than or fewer than two words.

Enter page ID or URL from sticker: 165088666
Title is '040000007eaf8470 KRONK'.
The title's second word is not one of ('COB', 'RTM', 'FLASH', 'DPM', 'DTM').

Enter page ID or URL from sticker: ^D

Filling in a device page: makepage.py

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 makepage.py. This command repeatedly prompts for a page ID or sticker URL for a page that's a child of the page "Unused HWDB pages". It checks that the page title is of the form "Unused HWDB page n" where n is a positive integer. Once you've selected the page the command prompts you for serial number, device class and type reference and updates the page accordingly. You're then asked to where you want to move the page.

makepage.py will add a comment to the page giving the "date of birth", e.g., ""

bash-3.2$ makepage.py
Fill in unused hardware database pages in Confluence.
Type control-D or control-C at a prompt to terminate.
While making a page type a period to abort the page.

Confluence password for tether:

Enter page ID or URL from sticker: 165088620

Device class?
0 COB
1 RTM
2 FLASH
3 DPM
4 DTM
? 0

Type field (hw revision)?
0 PC_248_101_01_C05
1 PC_248_101_01_C06
2 PC_248_101_01_C07
? 2

Serial number? 690000007e910c70

Move page to?
0 Site SLAC Lab 1
1 Spares SLAC Lab 1
? 1

Enter page ID or URL from sticker: ^D
 
  • No labels