예제 #1
0
파일: osutils.py 프로젝트: ycx516/octavia
 def get_os_util(cls):
     os_name = distro.id()
     for subclass in cls._get_subclasses():
         if subclass.is_os_name(os_name):
             return subclass(os_name)
     raise octavia_exceptions.InvalidAmphoraOperatingSystem(os_name=os_name)
예제 #2
0
 def get_os_util(cls):
     os_name = platform.linux_distribution(full_distribution_name=False)[0]
     for subclass in BaseOS.__subclasses__():
         if subclass.is_os_name(os_name):
             return subclass(os_name)
     raise octavia_exceptions.InvalidAmphoraOperatingSystem(os_name=os_name)