mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
parent
8c3fadf15e
commit
e6c4e4649b
@ -14,6 +14,7 @@ might look like::
|
|||||||
This data can also be passed into pillar. Options passed into opts will
|
This data can also be passed into pillar. Options passed into opts will
|
||||||
overwrite options passed into pillar
|
overwrite options passed into pillar
|
||||||
'''
|
'''
|
||||||
|
import re
|
||||||
import logging
|
import logging
|
||||||
from salt.utils import check_or_die
|
from salt.utils import check_or_die
|
||||||
from salt.exceptions import CommandNotFoundError
|
from salt.exceptions import CommandNotFoundError
|
||||||
@ -62,7 +63,7 @@ def _connection_defaults(user=None, host=None, port=None):
|
|||||||
return (user, host, port)
|
return (user, host, port)
|
||||||
|
|
||||||
def _quote(s):
|
def _quote(s):
|
||||||
r = s.replace("'", r"\'").replace('"', r'\"')
|
r = re.sub('([\'\"()])', r'\\\1', s)
|
||||||
if ' ' in s:
|
if ' ' in s:
|
||||||
r = "'%s'" % r
|
r = "'%s'" % r
|
||||||
return r
|
return r
|
||||||
|
Loading…
Reference in New Issue
Block a user