Skip to content

Commit

Permalink
Add valid_id to verify that a minion id is valid
Browse files Browse the repository at this point in the history
  • Loading branch information
thatch45 committed May 8, 2013
1 parent 4512da5 commit e200b8a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions salt/utils/verify.py
Expand Up @@ -429,3 +429,10 @@ def clean_path(root, path, subdir=False):
if os.path.dirname(path) == os.path.normpath(root):
return path
return ''


def valid_id(id_):
'''
Returns if the passed id is valid
'''
return bool(clean_path('/etc/pki/salt/master', id_))

0 comments on commit e200b8a

Please sign in to comment.