maas 不再启动

maas 不再启动

大众区域不再出现。

我使用的版本是:1.8.0+bzr4001-0ubuntu2~vivid1

这似乎是在更新到 1.8 后发生的

root@maas:/var/log/maas# export DJANGO_SETTINGS_MODULE=maas.settings
root@maas:/var/log/maas# export PYTHONPATH=/usr/share/maas
root@maas:/var/log/maas# export LOGFILE=/var/log/maas/regiond.log
root@maas:/var/log/maas# /usr/bin/twistd --nodaemon --pidfile= maas-regiond
Traceback (most recent call last):
  File "/usr/bin/twistd", line 14, in <module>
    run()
  File "/usr/lib/python2.7/dist-packages/twisted/scripts/twistd.py", line 27, in run
    app.run(runApp, ServerOptions)
  File "/usr/lib/python2.7/dist-packages/twisted/application/app.py", line 642, in run
    runApp(config)
  File "/usr/lib/python2.7/dist-packages/twisted/scripts/twistd.py", line 23, in runApp
    _SomeApplicationRunner(config).run()
  File "/usr/lib/python2.7/dist-packages/twisted/application/app.py", line 376, in run
    self.application = self.createOrGetApplication()
  File "/usr/lib/python2.7/dist-packages/twisted/application/app.py", line 436, in createOrGetApplication
    ser = plg.makeService(self.config.subOptions)
  File "/usr/lib/python2.7/dist-packages/maasserver/plugin.py", line 92, in makeService
    self._configureDjango()
  File "/usr/lib/python2.7/dist-packages/maasserver/plugin.py", line 71, in _configureDjango
    django_setup()
  File "/usr/lib/python2.7/dist-packages/django/__init__.py", line 20, in setup
    configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
  File "/usr/lib/python2.7/dist-packages/django/conf/__init__.py", line 46, in __getattr__
    self._setup(name)
  File "/usr/lib/python2.7/dist-packages/django/conf/__init__.py", line 42, in _setup
    self._wrapped = Settings(settings_module)
  File "/usr/lib/python2.7/dist-packages/django/conf/__init__.py", line 94, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/usr/share/maas/maas/__init__.py", line 128, in <module>
    object.__setattr__(django.conf.settings, "__class__", LazySettings)
AttributeError: can't set attribute

答案1

我也使用 MAAS 1.9 运行了此操作(按照 OpenStack 设置说明http://www.ubuntu.com/download/cloud/install-openstack-with-autopilot)。能够通过在我的计算机的文件系统上注释掉此行来解决(虽然在我的设置中它是第 115 行,但我认为它是 1.8/1.9 的差异):

文件“/usr/share/maas/maas/在里面.py”,第 128 行,在对象中。设置属性(django.conf.settings,“班级", 懒惰设置)

这样做之后,regiond 已开始发出正常日志,并且 MAAS 网页已正确显示。

上面这一行似乎有助于禁用一些不受欢迎的日志 - 不幸的是它也会杀死 MAAS,所以我认为注释掉并不是那么糟糕。

相关内容