History | View | Annotate | Download (11.7 kB)
Fix formatting of tuple in error message
The missing str() call caused to raise another exception than the wantedone. Transforming the tuple to string fixes this problem.
Signed-off-by: Thomas Thrainer <thomasth@google.com>Reviewed-by: Michele Tartara <mtartara@google.com>
uidpool: Remove roman number support
Doing so simplifies to code a bit and never had a practical use.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Migrate lib/uidpool.py from constants to pathutils
File system paths moved from constants to pathutils.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Fix uses of OpPrereqError without code info
A while back, we did cleanup the code and ensured (manually) that useof OpPrereqError includes an errors.ECODE_* field as secondargument. Since we cannot automate the check for this, it turns outthat more and more such usage has crept over the years, including in...
FormatUidPool: provide optional roman conversion
The convert= option of compat.tryToRoman is used to do optionalconversion without duplicating formatting code.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Use ints instead of strings to represent user-ids
Signed-off-by: Balazs Lecz <leczb@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
ReleaseUid: accept an integer as uid
We can't guarantee to keep the LockedObject around, when ReleaseUid iscalled (because that might happen, for example, after a ganetishutdown/restart). So we'll support releasing on just an integer uid.
Signed-off-by: Guido Trotter <ultrotter@google.com>...
LockedUid: add GetUid() method
uidpool users that get passed a LockedUid by the uidpool need to knowwhich one the uid is. Since it's not nice to make them access a privatemember, and we shouldn't make "uid" public either, we'll add a gettermethod.
Fix a couple of pydoc syntax problems
Signed-off-by: Balazs Lecz <leczb@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Add ExecuteWithUnusedUid() to uidpool.py
Manage the assignment of uids from the uid pool
Add uid_pool to ssconf
Add printing of uid_pool to gnt-cluster info
Add --add-uids/--remove-uids to gnt-cluster modify
Add lib/uidpool.py module