code: def remove_ifcfg_file(device_index='0'):
      
      log = logging.getLogger(mod_logger + '.remove_ifcfg_file')
      if not isinstance(device_index, basestring):
          msg = 'device_index argument must be a string'
          log.error(msg)
          raise CommandError(msg)
      network_script = '/etc/sysconfig/network-scripts/ifcfg-eth{d}'.format(d=device_index)
      if not os.path.isfile(network_script):
          log.info('File does not exist, nothing will be removed: {n}'.format(n=network_script))
          return
  
      # Remove the network config script
      log.info('Attempting to remove file: {n}'.format(n=network_script))
      try:
          os.remove(network_script)
      except(IOError, OSError):
          _, ex, trace = sys.exc_info()
          msg = 'There was a problem removing network script file: {n}\n{e}'.format(n=network_script, e=str(ex))
          log.error(msg)
          raise OSError, msg, trace
      else:
          log.info('Successfully removed file: {n}'.format(n=network_script))
  
      # Restart the network service
      log.info('Restarting the network service...')
      try:
          service_network_restart()
      except CommandError:
          _, ex, trace = sys.exc_info()
          msg = 'There was a problem restarting the network service\n{e}'.format(e=str(ex))
          log.error(msg)
          raise OSError, msg, trace
      else:
          log.info('Successfully restarted the network service')
docs: Removes the ifcfg file at the specified device index
      and restarts the network service
  
      :param device_index: (int) Device Index
      :return: None
      :raises CommandError