Browse Source

log from_fqdn configuration

master
Sean Johnson 3 years ago
parent
commit
83c5e96771
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS. GPG Key ID: 9FA15B87469EA850
  1. 8
      _grains/from_fqdn.py

8
_grains/from_fqdn.py

@ -21,13 +21,17 @@ _regex = re.compile(r"""
$ # end of string
""", re.VERBOSE)
_DEFAULT_USE_HOSTNAME = False
log = logging.getLogger(__name__)
def __virtual__():
""" Checks if the system's hostname can be matched by this module.
"""
results = _regex.findall(socket.getfqdn())
cfg = _get_config()
hostname = _get_hostname(cfg)
results = _regex.findall(hostname)
if results is not None and len(results) > 0:
return __virtualname__
@ -44,6 +48,8 @@ def _get_config(opts=None):
"use_hostname": cfg.get("use_hostname", _DEFAULT_USE_HOSTNAME),
}
log.debug("from_fqdn configuration: %s", cfg)
return cfg

Loading…
Cancel
Save