def sls_build(name, base='opensuse/python', mods=None, saltenv='base', **kwargs):
 create_kwargs = salt.utils.clean_kwargs(**copy.deepcopy(kwargs))
 for key in ('image', 'name', 'cmd', 'interactive', 'tty'):
  try:
   del create_kwargs[key]
  except KeyError:
   pass
 ret = __salt__['dockerng.create'](image=base, name=name, cmd='sleep infinity', interactive=True, tty=True, **create_kwargs)
 id_ = ret['Id']
 try:
  __salt__['dockerng.start'](id_)
  ret = __salt__['dockerng.sls'](id_, mods, saltenv, **kwargs)
  if (not salt.utils.check_state_result(ret)):
   raise CommandExecutionError(ret)
 finally:
  __salt__['dockerng.stop'](id_)
 return __salt__['dockerng.commit'](id_, name)

def sls_build ( name , base = 'opensuse/python' , mods = None , saltenv = 'base' , ** kwargs ) : create_kwargs = salt . utils . clean_kwargs ( ** copy . deepcopy ( kwargs ) ) for key in ( 'image' , 'name' , 'cmd' , 'interactive' , 'tty' ) : try : del create_kwargs [ key ] except KeyError : pass ret = __salt__ [ 'dockerng.create' ] ( image = base , name = name , cmd = 'sleep infinity' , interactive = True , tty = True , ** create_kwargs ) id_ = ret [ 'Id' ] try : __salt__ [ 'dockerng.start' ] ( id_ ) ret = __salt__ [ 'dockerng.sls' ] ( id_ , mods , saltenv , ** kwargs ) if ( not salt . utils . check_state_result ( ret ) ) : raise CommandExecutionError ( ret ) finally : __salt__ [ 'dockerng.stop' ] ( id_ ) return __salt__ [ 'dockerng.commit' ] ( id_ , name )
build a docker image using the specified sls modules and base image .