python manage.py compress: bin/sh: 1: lesscpy: not found

Bug #1242766 reported by Daniel Speichert
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Invalid
Undecided
Kieran Spear
horizon (Ubuntu)
Won't Fix
Undecided
Unassigned

Bug Description

When running the command to offline-compress theme:

root@cloud:/usr/share/openstack-dashboard# python manage.py compress
Found 'compress' tags in:
        /usr/share/openstack-dashboard/openstack_dashboard/templates/_stylesheets.html
        /usr/share/openstack-dashboard-drexel-theme/templates/_stylesheets.html
        /usr/lib/python2.7/dist-packages/horizon/templates/horizon/_conf.html
        /usr/lib/python2.7/dist-packages/horizon/templates/horizon/_scripts.html
Compressing... CommandError: An error occured during rendering /usr/share/openstack-dashboard/openstack_dashboard/templates/_stylesheets.html: /bin/sh: 1: lesscpy: not found

It stops trying to execute a bogus binary "lesscpy".
Doing:
# ln -s /usr/bin/lessc /usr/local/bin/lesscpy
fixes the issue.

Package: python-django-horizon
State: installed
Automatically installed: yes
Version: 1:2013.2~rc3-0ubuntu1~cloud0

Kieran Spear (kspear)
Changed in horizon:
status: New → Invalid
assignee: nobody → Kieran Spear (kspear)
Revision history for this message
Daniel Speichert (dasp) wrote :

Could you comment on the reason for why it is not a bug?

Revision history for this message
Kieran Spear (kspear) wrote :

It looks like a bug in packaging rather than in Horizon itself. I've retargeted it to the Ubuntu Horizon package, so the Ubuntu guys can take a look.

Revision history for this message
Kieran Spear (kspear) wrote :

FWIW, it looks like python-lesscpy isn't a hard dependency of the Ubuntu package, so you probably need to install it explictly if you want to use compression:

sudo apt-get install python-lesscpy

Revision history for this message
Matthias Runge (mrunge) wrote :

I'd like to add, when using COMPRESS_OFFLINE = True, you don't need a compressor at runtime. Especially this was a concern, when we used nodejs and less.js to compress, and nobody wants both permanently on a server for a task to be only run once.

Revision history for this message
Daniel Speichert (dasp) wrote :

So in fact the bug is in Ubuntu package - it should depend on python-lesscpy.

Revision history for this message
Matthias Runge (mrunge) wrote :

@Daniel Speichert, it depends; if COMPRESS_OFFLINE is set, python-lesscpy does NOT necessarily need to be installed at all. As other example, you don't install all test requirements on a server machine as well.

Revision history for this message
Daniel Speichert (dasp) wrote :

But even if COMPRESS_OFFLINE =True, then you still need python-lesscpy to manually execute "python manage.py compress", which is part of Horizon. So in all cases users need this package.

Revision history for this message
Matthias Runge (mrunge) wrote :

Yes exactly. And the same is true for run_tests.sh, where you need various other packages, or you accept, they will be fetched via internet, which might be allowed/disallowed by (firewall policy) or ...

Revision history for this message
Daniel Speichert (dasp) wrote :

Regular users don't run test but need to compress their templates. Isn't that a difference here? It's only this one package needed as dependency? Is this package at least "recommended"?

Revision history for this message
Kieran Spear (kspear) wrote :

python-lesscpy is "suggested" in the Horizon package:
https://bugs.launchpad.net/ubuntu/+source/horizon/+bug/1226674

AFAIK there should be no need to run compress as the Ubuntu package includes the compressed resources already.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in horizon (Ubuntu):
status: New → Confirmed
Revision history for this message
James Page (james-page) wrote :

The Ubuntu package for Horizon ships with COMPRESS_OFFLINE = True and all required assets pre-compressed as part of the packages.

So python-lesscpy is not required for normal operation, you should not need to re-run compression - hence its only a suggests.

Marking Won't Fix.

Changed in horizon (Ubuntu):
status: Confirmed → Won't Fix
Revision history for this message
James Pic (jamespic) wrote :

It would be so cool if someone who actually likes django did a new version of the horizon package ... then it would match expectations from all django users.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.