@salt.utils.decorators.which('rar')
def rar(rarfile, sources, template=None, cwd=None, runas=None):
 if isinstance(sources, string_types):
  sources = [s.strip() for s in sources.split(',')]
 cmd = ['rar', 'a', '-idp', '{0}'.format(rarfile)]
 cmd.extend(sources)
 return __salt__['cmd.run'](cmd, cwd=cwd, template=template, runas=runas, python_shell=False).splitlines()

@ salt . utils . decorators . which ( 'rar' ) def rar ( rarfile , sources , template = None , cwd = None , runas = None ) : if isinstance ( sources , string_types ) : sources = [ s . strip ( ) for s in sources . split ( ',' ) ] cmd = [ 'rar' , 'a' , '-idp' , '{0}' . format ( rarfile ) ] cmd . extend ( sources ) return __salt__ [ 'cmd.run' ] ( cmd , cwd = cwd , template = template , runas = runas , python_shell = False ) . splitlines ( )
uses rar for linux_ to create rar files .