Bug 38848 - Устаревший атрибут в скрипте etcnet.py для cloud-init
Summary: Устаревший атрибут в скрипте etcnet.py для cloud-init
Status: CLOSED FIXED
Alias: None
Product: Sisyphus
Classification: Development
Component: cloud-init (show other bugs)
Version: unstable
Hardware: x86_64 Linux
: P5 normal
Assignee: obirvalger@altlinux.org
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-26 11:47 MSK by Kot_Uchoniy
Modified: 2020-11-09 14:57 MSK (History)
3 users (show)

See Also:


Attachments
Заменен устаревший атрибут has_key (3.71 KB, text/plain)
2020-08-26 11:47 MSK, Kot_Uchoniy
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kot_Uchoniy 2020-08-26 11:47:59 MSK
Created attachment 8915 [details]
Заменен устаревший атрибут has_key

В файле скрипта /usr/lib/python3/site-packages/cloudinit/net/etcnet.py используется устаревший атрибут has_key. Для python3 вместо конструкции вида
if s.has_key('gateway')
нужно использовать
if 'gateway' in s
Прикладываю исправленный скрипт
Comment 1 Repository Robot 2020-11-09 14:57:26 MSK
cloud-init-20.1-alt2 -> sisyphus:

 Mon Nov 09 2020 Mikhail Gordeev <obirvalger@altlinux> 20.1-alt2
 - Fix dictionary key lookup for python3 (Closes: 38848)