diff --git a/bin/boto-rsync b/bin/boto-rsync index 76278b2..7ed8e80 100644 --- a/bin/boto-rsync +++ b/bin/boto-rsync @@ -181,7 +181,22 @@ def main(): num_cb = 10 rename = False copy_file = True - + + # Boto < 2.0 missing __version__, hence try/except + # S3 encryption support present in 2.1.0 and later + desired_boto = '2.1.0' + boto_err = 'Boto version %s or later is required\n' % desired_boto + boto_err += 'Try: sudo easy_install boto\n' + + try: + from pkg_resources import parse_version + if parse_version(boto.__version__) < parse_version(desired_boto): + sys.stdout.write(boto_err) + sys.exit(1) + except (AttributeError, NameError): + sys.stdout.write(boto_err) + sys.exit(1) + parser = argparse.ArgumentParser( formatter_class=argparse.RawDescriptionHelpFormatter, usage='%(prog)s [OPTIONS] SOURCE DESTINATION',