def _pull_status(data, item):
 def _already_exists(id_):
  '\n        Layer already exists\n        '
  already_pulled = data.setdefault('Layers', {}).setdefault('Already_Pulled', [])
  if (id_ not in already_pulled):
   already_pulled.append(id_)
 def _new_layer(id_):
  '\n        Pulled a new layer\n        '
  pulled = data.setdefault('Layers', {}).setdefault('Pulled', [])
  if (id_ not in pulled):
   pulled.append(id_)
 if ('dockerng._pull_status' not in __context__):
  log.warning('_pull_status context variable was not populated, information on downloaded layers may be inaccurate. Please report this to the SaltStack development team, and if possible include the image (and tag) that was being pulled.')
  __context__['dockerng._pull_status'] = NOTSET
 status = item['status']
 if (status == 'Already exists'):
  _already_exists(item['id'])
 elif (status in 'Pull complete'):
  _new_layer(item['id'])
 elif status.startswith('Status: '):
  data['Status'] = status[8:]
 elif (status == 'Download complete'):
  if (__context__['dockerng._pull_status'] is not NOTSET):
   id_ = item['id']
   if (id_ in __context__['dockerng._pull_status']):
    _already_exists(id_)
   else:
    _new_layer(id_)

def _pull_status ( data , item ) : def _already_exists ( id_ ) : already_pulled = data . setdefault ( 'Layers' , { } ) . setdefault ( 'Already_Pulled' , [ ] ) if ( id_ not in already_pulled ) : already_pulled . append ( id_ ) def _new_layer ( id_ ) : pulled = data . setdefault ( 'Layers' , { } ) . setdefault ( 'Pulled' , [ ] ) if ( id_ not in pulled ) : pulled . append ( id_ ) if ( 'dockerng._pull_status' not in __context__ ) : log . warning ( '_pull_status context variable was not populated, information on downloaded layers may be inaccurate. Please report this to the SaltStack development team, and if possible include the image (and tag) that was being pulled.' ) __context__ [ 'dockerng._pull_status' ] = NOTSET status = item [ 'status' ] if ( status == 'Already exists' ) : _already_exists ( item [ 'id' ] ) elif ( status in 'Pull complete' ) : _new_layer ( item [ 'id' ] ) elif status . startswith ( 'Status: ' ) : data [ 'Status' ] = status [ 8 : ] elif ( status == 'Download complete' ) : if ( __context__ [ 'dockerng._pull_status' ] is not NOTSET ) : id_ = item [ 'id' ] if ( id_ in __context__ [ 'dockerng._pull_status' ] ) : _already_exists ( id_ ) else : _new_layer ( id_ )
process a status update from a docker pull .