Versions Compared

Key

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

...

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.

Note

A couple of times I've seen a login from the HWDB Python software get stuck. When that happened the cure was to stop the software via control-C and log in to Confluence via the web using the same account. It seems that under some circumstances a login via the Command Line Interface is counted as a failed login and only a certain number of those are allowed. Logging in via the web clears the count of failed logins.

 

Creating blank pages:

...

makeblanks.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 blanksmakeblanks.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.. makeblanks.py will print the URLs of the newly created pages. Save these so that stickers may be printed from them.

bash-3.2$ blanksmakeblanks.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

Listing blank pages: listblanks.py

Just in case, you can use listblanks.py to list the URLs for all the children of the "Unused HWDB pages" page. The line with the page count is written to stderr while the URLs are written to stdout.

bash-3.2$ listblanks.py
Confluence password for tether:
30 pages
https://confluence.slac.stanford.edu/pages/viewpage.action?pageId=163485551
https://confluence.slac.stanford.edu/pages/viewpage.action?pageId=163485553
https://confluence.slac.stanford.edu/pages/viewpage.action?pageId=163485556
...

Getting a login token: hwdblogin.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.
  • contains two words: "HWDB" followed by the page ID.
  • The Type field is present and valid.
  • The Serial 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=163485572165089846               
Title is 'da0000007ed19970HWDB DPM165089846'.
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: 165088666https://confluence.slac.stanford.edu/pages/viewpage.action?pageId=165089846
Title is '040000007eaf8470HWDB KRONK165089846'.
The title's second word is not one of ('COB', 'RTM', 'FLASH', 'DPM', 'DTM').OK

Enter page ID or URL from sticker: ^D

Filling in a device page:

...

initpage.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 makepageinitpage.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 whether the Type and Serial fields are present and valid, prompting for the value of any missing or invalid field. The page is updated accordingly. You're then asked to where you want to move the page.

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

bash-3.2$ makepageinitpage.py
Fill in unusedincomplete 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 165089846
Type field is missing or blank.
 
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 field is missing or blank.
 
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