npm module

162 views
Skip to first unread message

Dmitry Golubenko

unread,
Apr 15, 2013, 11:26:29 PM4/15/13
to salt-...@googlegroups.com
hi,

npm.installed implicitly adds --json option which breaks some packages
(karma for example). w/o --json all works fine, can --json be made
optional state module argument? e.g.

npm.installed:
- name karma
- json: False

salt-call --local state.single npm.installed karma
[INFO ] Loaded configuration file: /etc/salt/minion
[WARNING ] Both 'dmidecode' and 'lspci' failed to execute, either
because they do not exist on the system of the user running this
instance does not have the necessary permissions to execute them.
Grains output might not be accurate.
[INFO ] Executing command 'ps -efH' in directory '/root'
[WARNING ] Both 'dmidecode' and 'lspci' failed to execute, either
because they do not exist on the system of the user running this
instance does not have the necessary permissions to execute them.
Grains output might not be accurate.
[INFO ] Loading fresh modules for state activity
[INFO ] Executing state npm.installed for karma
[INFO ] Executing command 'npm list --json --global' in directory
'/root'
[INFO ] Executing command 'npm install --json --global karma' in
directory '/root'
[ERROR ] No changes made for karma
local:
----------
State: - npm
Name: karma
Function: installed
Result: False
Comment: An exception occured in this state: Traceback (most
recent call last):
File "/usr/lib/python2.7/site-packages/salt/state.py", line 1208, in
call
*cdata['args'], **cdata['kwargs'])
File "/usr/lib/python2.7/site-packages/salt/states/npm.py", line 53,
in installed
runas=runas
File "/usr/lib/python2.7/site-packages/salt/modules/npm.py", line
52, in install
return json.loads(''.join(lines))
File "/usr/lib64/python2.7/json/__init__.py", line 326, in loads
return _default_decoder.decode(s)
File "/usr/lib64/python2.7/json/decoder.py", line 366, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib64/python2.7/json/decoder.py", line 384, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

Changes:


Niels Abspoel

unread,
Apr 16, 2013, 1:17:20 AM4/16/13
to salt-...@googlegroups.com, dmitry.g...@xiag.ch
please look at this commit:

I think that fixes your issue.


Op dinsdag 16 april 2013 05:26:29 UTC+2 schreef Dmitry Golubenko het volgende:

Dmitry Golubenko

unread,
Apr 16, 2013, 2:16:42 AM4/16/13
to salt-...@googlegroups.com
On 04/16/2013 12:17 PM, Niels Abspoel wrote:
> please look at this commit:
> https://github.com/saltstack/salt/commit/a2d060446543c1b57c17093887ef935471addaeb
>
> I think that fixes your issue.
I think it should, thank you!

will it get to 0.14.2 (or 0/15.0) ? or i should just apply this patch
during package build ?

Thomas S Hatch

unread,
Apr 17, 2013, 1:27:36 PM4/17/13
to salt-...@googlegroups.com
This will be in 0.15.0
I am not sure that we will make a 0.14.2

Thomas S. Hatch  |  Founder, CTO


5272 South College Drive, Suite 301 | Murray, UT 84123


--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



Reply all
Reply to author
Forward
0 new messages