Skip to main content

Posts

Showing posts from May, 2015

Python self keyword not mandatory

A long time ago I subscribed to the Python language mailing list, and today I discovered in a discussion that "self" is not mandatory. https://docs.python.org/2/tutorial/classes.html#random-remarks states: Often, the first argument of a method is called self. This is nothing more than a convention: the name self has absolutely no special meaning to Python. Note, however, that by not following the convention your code may be less readable to other Python programmers, and it is also conceivable that a class browser program might be written that relies upon such a convention.  It might obvious for some, but for me it is worth of note.

Get UUID from VM and ESX

Sometimes one wants to get the relation between a VM from the ESX inventory and from the system. From ESX:   # esxcli vm process list   vm-inventory-name   ...   UUID: 56 4d 7c f7 f7 a6 a3 b1-fb 71 cd 3b 3c 34 65 0a From Linux command line   $ sudo dmidecode | grep UUID   UUID: 564D7CF7-F7A6-A3B1-FB71-CD3B3C34650A This is the relation and it's up to the user to reformat all these outputs.