def zone_compare(timezone):
 if ('Solaris' in __grains__['os_family']):
  return (timezone == get_zone())
 tzfile = _get_etc_localtime_path()
 zonepath = _get_zone_file(timezone)
 try:
  return filecmp.cmp(tzfile, zonepath, shallow=False)
 except OSError as exc:
  problematic_file = exc.filename
  if (problematic_file == zonepath):
   raise SaltInvocationError('Can\'t find a local timezone "{0}"'.format(timezone))
  elif (problematic_file == tzfile):
   raise CommandExecutionError('Failed to read {0} to determine current timezone: {1}'.format(tzfile, exc.strerror))
  raise

def zone_compare ( timezone ) : if ( 'Solaris' in __grains__ [ 'os_family' ] ) : return ( timezone == get_zone ( ) ) tzfile = _get_etc_localtime_path ( ) zonepath = _get_zone_file ( timezone ) try : return filecmp . cmp ( tzfile , zonepath , shallow = False ) except OSError as exc : problematic_file = exc . filename if ( problematic_file == zonepath ) : raise SaltInvocationError ( 'Can\'t find a local timezone "{0}"' . format ( timezone ) ) elif ( problematic_file == tzfile ) : raise CommandExecutionError ( 'Failed to read {0} to determine current timezone: {1}' . format ( tzfile , exc . strerror ) ) raise
compares the given timezone name with the system timezone name .