contrib/automation/hgautomation/aws.py
changeset 47195 546e812a1c2d
parent 45942 89a2afe31e82
child 48747 ae28d37f5969
equal deleted inserted replaced
47194:acd84c434896 47195:546e812a1c2d
   923         pathlib.Path(__file__).parent.parent / 'linux-requirements-py2.txt'
   923         pathlib.Path(__file__).parent.parent / 'linux-requirements-py2.txt'
   924     )
   924     )
   925     requirements3_path = (
   925     requirements3_path = (
   926         pathlib.Path(__file__).parent.parent / 'linux-requirements-py3.txt'
   926         pathlib.Path(__file__).parent.parent / 'linux-requirements-py3.txt'
   927     )
   927     )
       
   928     requirements35_path = (
       
   929         pathlib.Path(__file__).parent.parent / 'linux-requirements-py3.5.txt'
       
   930     )
   928     with requirements2_path.open('r', encoding='utf-8') as fh:
   931     with requirements2_path.open('r', encoding='utf-8') as fh:
   929         requirements2 = fh.read()
   932         requirements2 = fh.read()
   930     with requirements3_path.open('r', encoding='utf-8') as fh:
   933     with requirements3_path.open('r', encoding='utf-8') as fh:
   931         requirements3 = fh.read()
   934         requirements3 = fh.read()
       
   935     with requirements35_path.open('r', encoding='utf-8') as fh:
       
   936         requirements35 = fh.read()
   932 
   937 
   933     # Compute a deterministic fingerprint to determine whether image needs to
   938     # Compute a deterministic fingerprint to determine whether image needs to
   934     # be regenerated.
   939     # be regenerated.
   935     fingerprint = resolve_fingerprint(
   940     fingerprint = resolve_fingerprint(
   936         {
   941         {
   937             'instance_config': config,
   942             'instance_config': config,
   938             'bootstrap_script': BOOTSTRAP_DEBIAN,
   943             'bootstrap_script': BOOTSTRAP_DEBIAN,
   939             'requirements_py2': requirements2,
   944             'requirements_py2': requirements2,
   940             'requirements_py3': requirements3,
   945             'requirements_py3': requirements3,
       
   946             'requirements_py35': requirements35,
   941         }
   947         }
   942     )
   948     )
   943 
   949 
   944     existing_image = find_and_reconcile_image(ec2resource, name, fingerprint)
   950     existing_image = find_and_reconcile_image(ec2resource, name, fingerprint)
   945 
   951 
   975                 fh.write(requirements2)
   981                 fh.write(requirements2)
   976                 fh.chmod(0o0700)
   982                 fh.chmod(0o0700)
   977 
   983 
   978             with sftp.open('%s/requirements-py3.txt' % home, 'wb') as fh:
   984             with sftp.open('%s/requirements-py3.txt' % home, 'wb') as fh:
   979                 fh.write(requirements3)
   985                 fh.write(requirements3)
       
   986                 fh.chmod(0o0700)
       
   987 
       
   988             with sftp.open('%s/requirements-py3.5.txt' % home, 'wb') as fh:
       
   989                 fh.write(requirements35)
   980                 fh.chmod(0o0700)
   990                 fh.chmod(0o0700)
   981 
   991 
   982             print('executing bootstrap')
   992             print('executing bootstrap')
   983             chan, stdin, stdout = ssh_exec_command(
   993             chan, stdin, stdout = ssh_exec_command(
   984                 client, '%s/bootstrap' % home
   994                 client, '%s/bootstrap' % home