Public bug reported:

I tried to apply a custom theme on master and stable/pike...I ran
 tox -e manage collectstaic, it failed like the followings:

manage runtests: commands[0] | 
/home/gugl/dev/my_upstream_horizon/.tox/manage/bin/python 
/home/gugl/dev/my_upstream_horizon/manage.py collectstatic
Traceback (most recent call last):
  File "/home/gugl/dev/my_upstream_horizon/manage.py", line 23, in <module>
    execute_from_command_line(sys.argv)
  File 
"/home/gugl/dev/my_upstream_horizon/.tox/manage/lib/python2.7/site-packages/django/core/management/__init__.py",
 line 363, in execute_from_command_line
    utility.execute()
  File 
"/home/gugl/dev/my_upstream_horizon/.tox/manage/lib/python2.7/site-packages/django/core/management/__init__.py",
 line 307, in execute
    settings.INSTALLED_APPS
  File 
"/home/gugl/dev/my_upstream_horizon/.tox/manage/lib/python2.7/site-packages/django/conf/__init__.py",
 line 56, in __getattr__
    self._setup(name)
  File 
"/home/gugl/dev/my_upstream_horizon/.tox/manage/lib/python2.7/site-packages/django/conf/__init__.py",
 line 41, in _setup
    self._wrapped = Settings(settings_module)
  File 
"/home/gugl/dev/my_upstream_horizon/.tox/manage/lib/python2.7/site-packages/django/conf/__init__.py",
 line 110, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/home/gugl/dev/my_upstream_horizon/openstack_dashboard/settings.py", 
line 439, in <module>
    THEME_COLLECTION_DIR, ROOT_PATH)
  File 
"/home/gugl/dev/my_upstream_horizon/openstack_dashboard/utils/settings.py", 
line 332, in find_static_files
    (templates_part, override_path) = theme_file.split('/templates/')
ValueError: need more than 1 value to unpack
ERROR: InvocationError: 
'/home/gugl/dev/my_upstream_horizon/.tox/manage/bin/python 
/home/gugl/dev/my_upstream_horizon/manage.py collectstatic'
___________________________________________________________ summary 
____________________________________________________________
ERROR:   manage: commands failed

If I added an if statement like the following in 
openstack_dashboard/utils/settings.py
            if '/templates/' in theme_file:
                (templates_part, override_path) = 
theme_file.split('/templates/')
                template_overrides[override_path] = 'themes/' + \
                                                    theme_name + theme_file

then it succeeds.

** Affects: horizon
     Importance: Undecided
     Assignee: Gloria Gu (gloria-gu)
         Status: New

** Changed in: horizon
     Assignee: (unassigned) => Gloria Gu (gloria-gu)

** Description changed:

- I am trying to applied the custom themes on master and stable/pike...and
- run tox -e manage collectstaic, it failed like the followings:
+ I tried to apply a custom theme on master and stable/pike...I ran
+  tox -e manage collectstaic, it failed like the followings:
  
  manage runtests: commands[0] | 
/home/gugl/dev/my_upstream_horizon/.tox/manage/bin/python 
/home/gugl/dev/my_upstream_horizon/manage.py collectstatic
  Traceback (most recent call last):
-   File "/home/gugl/dev/my_upstream_horizon/manage.py", line 23, in <module>
-     execute_from_command_line(sys.argv)
-   File 
"/home/gugl/dev/my_upstream_horizon/.tox/manage/lib/python2.7/site-packages/django/core/management/__init__.py",
 line 363, in execute_from_command_line
-     utility.execute()
-   File 
"/home/gugl/dev/my_upstream_horizon/.tox/manage/lib/python2.7/site-packages/django/core/management/__init__.py",
 line 307, in execute
-     settings.INSTALLED_APPS
-   File 
"/home/gugl/dev/my_upstream_horizon/.tox/manage/lib/python2.7/site-packages/django/conf/__init__.py",
 line 56, in __getattr__
-     self._setup(name)
-   File 
"/home/gugl/dev/my_upstream_horizon/.tox/manage/lib/python2.7/site-packages/django/conf/__init__.py",
 line 41, in _setup
-     self._wrapped = Settings(settings_module)
-   File 
"/home/gugl/dev/my_upstream_horizon/.tox/manage/lib/python2.7/site-packages/django/conf/__init__.py",
 line 110, in __init__
-     mod = importlib.import_module(self.SETTINGS_MODULE)
-   File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module
-     __import__(name)
-   File "/home/gugl/dev/my_upstream_horizon/openstack_dashboard/settings.py", 
line 439, in <module>
-     THEME_COLLECTION_DIR, ROOT_PATH)
-   File 
"/home/gugl/dev/my_upstream_horizon/openstack_dashboard/utils/settings.py", 
line 332, in find_static_files
-     (templates_part, override_path) = theme_file.split('/templates/')
+   File "/home/gugl/dev/my_upstream_horizon/manage.py", line 23, in <module>
+     execute_from_command_line(sys.argv)
+   File 
"/home/gugl/dev/my_upstream_horizon/.tox/manage/lib/python2.7/site-packages/django/core/management/__init__.py",
 line 363, in execute_from_command_line
+     utility.execute()
+   File 
"/home/gugl/dev/my_upstream_horizon/.tox/manage/lib/python2.7/site-packages/django/core/management/__init__.py",
 line 307, in execute
+     settings.INSTALLED_APPS
+   File 
"/home/gugl/dev/my_upstream_horizon/.tox/manage/lib/python2.7/site-packages/django/conf/__init__.py",
 line 56, in __getattr__
+     self._setup(name)
+   File 
"/home/gugl/dev/my_upstream_horizon/.tox/manage/lib/python2.7/site-packages/django/conf/__init__.py",
 line 41, in _setup
+     self._wrapped = Settings(settings_module)
+   File 
"/home/gugl/dev/my_upstream_horizon/.tox/manage/lib/python2.7/site-packages/django/conf/__init__.py",
 line 110, in __init__
+     mod = importlib.import_module(self.SETTINGS_MODULE)
+   File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module
+     __import__(name)
+   File "/home/gugl/dev/my_upstream_horizon/openstack_dashboard/settings.py", 
line 439, in <module>
+     THEME_COLLECTION_DIR, ROOT_PATH)
+   File 
"/home/gugl/dev/my_upstream_horizon/openstack_dashboard/utils/settings.py", 
line 332, in find_static_files
+     (templates_part, override_path) = theme_file.split('/templates/')
  ValueError: need more than 1 value to unpack
  ERROR: InvocationError: 
'/home/gugl/dev/my_upstream_horizon/.tox/manage/bin/python 
/home/gugl/dev/my_upstream_horizon/manage.py collectstatic'
  ___________________________________________________________ summary 
____________________________________________________________
  ERROR:   manage: commands failed
  
- 
- If I update to add if statement like the following in 
openstack_dashboard/utils/settings.py 
-             if '/templates/' in theme_file:
-                 (templates_part, override_path) = 
theme_file.split('/templates/')
-                 template_overrides[override_path] = 'themes/' + \
-                                                     theme_name + theme_file
+ If I added an if statement like the following in 
openstack_dashboard/utils/settings.py
+             if '/templates/' in theme_file:
+                 (templates_part, override_path) = 
theme_file.split('/templates/')
+                 template_overrides[override_path] = 'themes/' + \
+                                                     theme_name + theme_file
  
  then it succeeds.

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Dashboard (Horizon).
https://bugs.launchpad.net/bugs/1745234

Title:
  tox -e manage collectstatic  is broken for custom theme

Status in OpenStack Dashboard (Horizon):
  New

Bug description:
  I tried to apply a custom theme on master and stable/pike...I ran
   tox -e manage collectstaic, it failed like the followings:

  manage runtests: commands[0] | 
/home/gugl/dev/my_upstream_horizon/.tox/manage/bin/python 
/home/gugl/dev/my_upstream_horizon/manage.py collectstatic
  Traceback (most recent call last):
    File "/home/gugl/dev/my_upstream_horizon/manage.py", line 23, in <module>
      execute_from_command_line(sys.argv)
    File 
"/home/gugl/dev/my_upstream_horizon/.tox/manage/lib/python2.7/site-packages/django/core/management/__init__.py",
 line 363, in execute_from_command_line
      utility.execute()
    File 
"/home/gugl/dev/my_upstream_horizon/.tox/manage/lib/python2.7/site-packages/django/core/management/__init__.py",
 line 307, in execute
      settings.INSTALLED_APPS
    File 
"/home/gugl/dev/my_upstream_horizon/.tox/manage/lib/python2.7/site-packages/django/conf/__init__.py",
 line 56, in __getattr__
      self._setup(name)
    File 
"/home/gugl/dev/my_upstream_horizon/.tox/manage/lib/python2.7/site-packages/django/conf/__init__.py",
 line 41, in _setup
      self._wrapped = Settings(settings_module)
    File 
"/home/gugl/dev/my_upstream_horizon/.tox/manage/lib/python2.7/site-packages/django/conf/__init__.py",
 line 110, in __init__
      mod = importlib.import_module(self.SETTINGS_MODULE)
    File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module
      __import__(name)
    File "/home/gugl/dev/my_upstream_horizon/openstack_dashboard/settings.py", 
line 439, in <module>
      THEME_COLLECTION_DIR, ROOT_PATH)
    File 
"/home/gugl/dev/my_upstream_horizon/openstack_dashboard/utils/settings.py", 
line 332, in find_static_files
      (templates_part, override_path) = theme_file.split('/templates/')
  ValueError: need more than 1 value to unpack
  ERROR: InvocationError: 
'/home/gugl/dev/my_upstream_horizon/.tox/manage/bin/python 
/home/gugl/dev/my_upstream_horizon/manage.py collectstatic'
  ___________________________________________________________ summary 
____________________________________________________________
  ERROR:   manage: commands failed

  If I added an if statement like the following in 
openstack_dashboard/utils/settings.py
              if '/templates/' in theme_file:
                  (templates_part, override_path) = 
theme_file.split('/templates/')
                  template_overrides[override_path] = 'themes/' + \
                                                      theme_name + theme_file

  then it succeeds.

To manage notifications about this bug go to:
https://bugs.launchpad.net/horizon/+bug/1745234/+subscriptions

-- 
Mailing list: https://launchpad.net/~yahoo-eng-team
Post to     : yahoo-eng-team@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yahoo-eng-team
More help   : https://help.launchpad.net/ListHelp

Reply via email to