Trove version
Git show headcommit f644fdcdb5695de53422ea27bce19f4262413d9emerge:7d219aa 9f17051author:jenkins <[email protected ]>date:thu Jan 02:10:02 +0000 Merge "Add i18n translation to others 1/3"
Source
# trove/guestagent/datastore/mysql_common/service.py 1084 Line def disable_root (self): "", Reset the root password to An unknown value. "" "Self.enable_root (Root_password=none)
Disable_root call Enable_root set root password to random password
Source
# trove/guestagent/datastore/mysql_common/service.py 1051 Line def enable_root (self, Root_password=none): "" "Enable The root user global access and/or reset the root password. "" "User = models. Mysqluser.root (Password=root_password) ...
Models. Mysqluser Code
# trove/common/db/mysql/models.py 121 Line Class Mysqluser (models. Datastoreuser): "" "represents a MySQL User and its associated properties." " Not_supported_chars = Re.compile ("^\s|\s$|" | \"|;| ' |,|/|\\\\ ') def _is_valid_string (self, value): ...
Models. Mysqluser.root inherited from Models.datastoreuser
Models. Datastoreuser.root Code
# trove/common/db/models.py 229 line Class datastoreuser (datastoremodelsbase): "" "Represents a datastore user" "" " _HOSTNAME_WILDCARD = '% ' root_username = ' Root ' ... @classmethod def root (cls, name=none, Password=none, *args, **kwargs): if not Name: name = cls.root_ username if not password: password = utils.generate_random_password () user = cls (Name, password, *args, **kwargs) user.make_root () &Nbsp; return user
You can see from the code that when password is none, a password is randomly generated for password, so trove root-show will still show root is enable after Trove root-disable.
This article is from the "Wuling Grassland" blog, please make sure to keep this source http://penguintux.blog.51cto.com/3021117/1893196
Trove Root-disable Code Analysis