2020년 1월 1일부터 Python 커뮤니티는 더 이상 Python 2.7의 업데이트, 버그 수정 또는 보안 문제 패치를 제공하지 않습니다. 가능한 한 빨리 Deployment Manager 템플릿이 Python 3과 호환되는지 확인하는 것이 좋습니다.
Google Cloud Python 클라이언트 라이브러리 사용에 대한 정보를 포함하여 이 변경사항의 영향을 받는 제품에 대한 개요는 Google Cloud에서 Python 지원을 참고하세요.
Deployment Manager 템플릿 마이그레이션
Deployment Manager 구문은 Python 3에만 해당하는 기능을 사용하지 않습니다. 대부분의 경우 템플릿은 코드를 변경할 필요 없이 Python 3에서 작동합니다.
도우미 스크립트와 같은 템플릿 모듈을 사용할 경우 스크립트가 Python 3과 호환되는지 확인해야 합니다.
Python 2 코드를 Python 3로 포팅하는 방법은 Python.org 포팅 가이드를 참조하세요.
템플릿이 Python 3와 호환되는지 테스트하려면 템플릿을 사용하여 테스트 배포를 테스트해 봅니다. 배포가 경고 없이 성공하면 템플릿은 호환되는 것이며 변경할 필요가 없습니다.
템플릿에 Python 3과 호환되지 않는 기능이 있으면 배포는 2020년 6월까지 계속 작동합니다. 다음 경고 중 하나가 표시될 수 있습니다.
템플릿이 Python 3과 호환되지 않습니다. 템플릿은 Python 2를 통해 실행되지만 Python 3에서는 실패합니다. 경고에는 코드를 디버깅할 수 있도록 Python 3 오류 메시지가 표시됩니다.
템플릿은 Python 3 또는 Python 2에 따라 다른 결과를 생성합니다. 배포가 확정적이지 않거나(예: 현재 시간 또는 랜덤 숫자 사용) 템플릿에서 Python 3과 호환되지 않는 기능을 사용할 수 있기 때문입니다. 템플릿이 설계상 확정적이지 않은 경우에는 템플릿을 변경할 필요가 없습니다.
템플릿이 Python 3과 호환되지 않는 기능을 사용하는 경우 Python 3 포팅 가이드의 가이드라인을 사용하여 템플릿을 업데이트합니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-03(UTC)"],[[["\u003cp\u003ePython 2.7 will no longer receive updates, bug fixes, or security patches from the Python community after January 1, 2020, so ensuring Deployment Manager templates are compatible with Python 3 is advised.\u003c/p\u003e\n"],["\u003cp\u003eDeployment Manager templates generally do not require code changes to be compatible with Python 3, unless template modules or helper scripts are used.\u003c/p\u003e\n"],["\u003cp\u003eTesting templates for Python 3 compatibility can be done by attempting a test deployment, which, if successful without warnings, indicates compatibility.\u003c/p\u003e\n"],["\u003cp\u003eTemplates incompatible with Python 3 will continue to function until June 2020, but may produce warnings indicating incompatibility or different results compared to Python 2.\u003c/p\u003e\n"],["\u003cp\u003eThe Python.org porting guide can help users with migration of incompatible features to Python 3 if needed.\u003c/p\u003e\n"]]],[],null,["# Migrate your templates to Python 3\n\n[Starting on January 1, 2020](https://www.python.org/doc/sunset-python-2/),\nthe Python community will no longer update,\nfix bugs, or patch security issues for Python 2.7. We recommend that you make\nsure that your Deployment Manager templates are compatible with Python 3 as\nsoon as possible.\n\nFor an overview of the products affected by this change, including information\nabout using the Google Cloud Python client libraries, see\n[Python support on Google Cloud](/python/docs/python2-sunset).\n\nMigrating your Deployment Manager templates\n-------------------------------------------\n\nThe syntax for Deployment Manager does not use any features specific to\nPython 3. In most cases, your templates should work with Python 3 without\nrequiring code changes.\n\nIf you use [template modules](/deployment-manager/docs/configuration/templates/create-template-modules)\nsuch as helper scripts, you must make sure that the scripts are compatible with\nPython 3.\n\nFor information on porting Python 2 code to Python 3, see the\n[Python.org porting guide](https://docs.python.org/3/howto/pyporting.html).\nIf you want to test whether your template is compatible with\nPython 3, try a test deployment with the template. If the deployment succeeds\nwithout any warnings, your template is compatible, and doesn't need changes.\n\nIf your templates have features that are incompatible with Python 3, your\ndeployments will continue to work until June 2020. You might see one of\nthese warnings:\n\n- The template is incompatible with Python 3: The template runs using Python 2,\n but fails with Python 3. The warning shows the Python 3 error message, so that\n you can debug your code.\n\n- The template produced different results with Python 3 and Python 2: This\n could be because your deployment is non-deterministic (for example, it relies\n on the current time or random numbers), or a template might be using a feature\n incompatible with Python 3. If your template is non-deterministic by design,\n you don't need to change it.\n\n If your template uses a feature that is incompatible with Python 3,\n use the guidelines in the\n [Python 3 porting guide](https://docs.python.org/3/howto/pyporting.html)\n to update the template."]]