def inject_data_into_fs(fs, key, net, metadata, admin_password, files, mandatory=()):
 items = {'key': key, 'net': net, 'metadata': metadata, 'admin_password': admin_password, 'files': files}
 functions = {'key': _inject_key_into_fs, 'net': _inject_net_into_fs, 'metadata': _inject_metadata_into_fs, 'admin_password': _inject_admin_password_into_fs, 'files': _inject_files_into_fs}
 status = True
 for (inject, inject_val) in items.items():
  if inject_val:
   try:
    inject_func = functions[inject]
    inject_func(inject_val, fs)
   except Exception as e:
    if (inject in mandatory):
     raise
    LOG.warning(_LW('Ignoring error injecting %(inject)s into image (%(e)s)'), {'inject': inject, 'e': e})
    status = False
 return status

def inject_data_into_fs ( fs , key , net , metadata , admin_password , files , mandatory = ( ) ) : items = { 'key' : key , 'net' : net , 'metadata' : metadata , 'admin_password' : admin_password , 'files' : files } functions = { 'key' : _inject_key_into_fs , 'net' : _inject_net_into_fs , 'metadata' : _inject_metadata_into_fs , 'admin_password' : _inject_admin_password_into_fs , 'files' : _inject_files_into_fs } status = True for ( inject , inject_val ) in items . items ( ) : if inject_val : try : inject_func = functions [ inject ] inject_func ( inject_val , fs ) except Exception as e : if ( inject in mandatory ) : raise LOG . warning ( _LW ( 'Ignoring error injecting %(inject)s into image (%(e)s)' ) , { 'inject' : inject , 'e' : e } ) status = False return status
injects data into a filesystem already mounted by the caller .