FAQ
I'm working on a masterless Windows setup process on EC2 and I'm having
trouble getting boto and salt-cloud working.

I've installed Python 2.7.9 and added the Boto module, but when I go to
import it inside of Salt, I get:

   File "c:\Python27\lib\site-packages\boto\exception.py", line 28, in
<module>
     import xml.sax
ImportError: No module named sax

I think my PYTHONPATH is set correctly:

C:\salt>echo %PYTHONPATH%
C:\Python27;C:\Python27\Lib;C:\Python27\Lib\site-packages

But Salt doesn't seem to be using it:
['C:\\salt\\salt-2014.7.1.win-amd64\\library.zip',
'c:\\salt\\salt-2014.7.1.win-amd64\\esky-0.9.8-py2.7.egg',
'c:\\salt\\salt-2014.7.1.win-amd64\\jinja2-2.7.1-py2.7.egg',
'c:\\salt\\salt-2014.7.1.win-amd64\\markupsafe-0.18-py2.7.egg',
'c:\\salt\\salt-2014.7.1.win-am64\\msgpack_python-0.4.2-py2.7-win-amd64.egg',
'c:\\salt\\salt-2014.7.1.win-amd64\\psutil-2.1.0-py2.7-win-amd64.egg',
'c:\\salt\\salt-2014.7.1.win-amd64\\pyzmq-14.1.1-py2.7-win-amd64.egg',
'c:\\salt\\salt-2014.7.1.win-amd64\\salt-2014.7.1-py2.7.egg',
'c:\\salt\\salt-2014.7.1.win-amd64\\setuptools-1.1.6-py2.7.egg',
'c:\\salt\\salt-2014.7.1.win-amd64\\wmi-1.4.9-py2.7.egg', 'C:\\salt\\salt-2014.7.1.win-amd64',
*'c:\\Python27', 'c:\\Python27\\lib\\site-packages'*]

I assume this is something to do with how the library is vendored into the
Salt windows installer directory.

I also tried making a .egg file and dropping it into the Salt directory,
which had the same error until I manually shoved lib/xml/sax.pyc and
lib/logging/config.pyc into the library.zip file.

My use case is that I'm want to use the salt-cloud modules
(http://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.cloud.html)
to look up other machines in EC2 to get their IPs (rather than using a
master and a mine) and also add the machine to load balancers/DNS etc.

I'd like to avoid doing my own Windows fork of Salt just to add a few
additional modules. Does anyone have any advice on how to do this? I really
would like to be able to use additional modules with Salt, but the Windows
packaging process seems to make that very difficult without putting the
modules in at build time.

Alternatively, if I wanted to make the effort, could I technically bypass
the Windows installer entirely and install all the deps
(https://github.com/saltstack/salt-windows-install) and python files from
git, then just start Salt like I would on a Linux box?

--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Joseph Hall at Jan 18, 2015 at 7:58 pm
    Hi Tiru,

    You're right, Salt does not use xml.sax, but boto seems to use it
    extensively. While none of Salt Cloud uses boto at all, the boto_*
    execution modules in Salt do.

    Since this is a boto issue, I would check with them to see if they have any
    ideas for reliable Windows usage. I wouldn't be surprised if they've run
    across this already.
    On Sun, Jan 18, 2015 at 12:13 PM, Tiru Srikantha wrote:

    I'm working on a masterless Windows setup process on EC2 and I'm having
    trouble getting boto and salt-cloud working.

    I've installed Python 2.7.9 and added the Boto module, but when I go to
    import it inside of Salt, I get:

    File "c:\Python27\lib\site-packages\boto\exception.py", line 28, in
    <module>
    import xml.sax
    ImportError: No module named sax

    I think my PYTHONPATH is set correctly:

    C:\salt>echo %PYTHONPATH%
    C:\Python27;C:\Python27\Lib;C:\Python27\Lib\site-packages

    But Salt doesn't seem to be using it:
    ['C:\\salt\\salt-2014.7.1.win-amd64\\library.zip',
    'c:\\salt\\salt-2014.7.1.win-amd64\\esky-0.9.8-py2.7.egg',
    'c:\\salt\\salt-2014.7.1.win-amd64\\jinja2-2.7.1-py2.7.egg',
    'c:\\salt\\salt-2014.7.1.win-amd64\\markupsafe-0.18-py2.7.egg',
    'c:\\salt\\salt-2014.7.1.win-am64\\msgpack_python-0.4.2-py2.7-win-amd64.egg',
    'c:\\salt\\salt-2014.7.1.win-amd64\\psutil-2.1.0-py2.7-win-amd64.egg',
    'c:\\salt\\salt-2014.7.1.win-amd64\\pyzmq-14.1.1-py2.7-win-amd64.egg',
    'c:\\salt\\salt-2014.7.1.win-amd64\\salt-2014.7.1-py2.7.egg',
    'c:\\salt\\salt-2014.7.1.win-amd64\\setuptools-1.1.6-py2.7.egg',
    'c:\\salt\\salt-2014.7.1.win-amd64\\wmi-1.4.9-py2.7.egg', 'C:\\salt\\salt-2014.7.1.win-amd64',
    *'c:\\Python27', 'c:\\Python27\\lib\\site-packages'*]

    I assume this is something to do with how the library is vendored into the
    Salt windows installer directory.

    I also tried making a .egg file and dropping it into the Salt directory,
    which had the same error until I manually shoved lib/xml/sax.pyc and
    lib/logging/config.pyc into the library.zip file.

    My use case is that I'm want to use the salt-cloud modules (
    http://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.cloud.html)
    to look up other machines in EC2 to get their IPs (rather than using a
    master and a mine) and also add the machine to load balancers/DNS etc.

    I'd like to avoid doing my own Windows fork of Salt just to add a few
    additional modules. Does anyone have any advice on how to do this? I really
    would like to be able to use additional modules with Salt, but the Windows
    packaging process seems to make that very difficult without putting the
    modules in at build time.

    Alternatively, if I wanted to make the effort, could I technically bypass
    the Windows installer entirely and install all the deps (
    https://github.com/saltstack/salt-windows-install) and python files from
    git, then just start Salt like I would on a Linux box?

    --
    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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.


    --
    "In order to create, you have to have the willingness, the desire to be
    challenged, to be learning." -- Ferran Adria (speaking at Harvard, 2011)

    --
    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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Tiru Srikantha at Jan 19, 2015 at 6:46 am
    I'm sorry, but this is entirely due to the way with which Salt packages the
    Python library into a zip file and then references it in the Windows
    client. It has nothing to do with boto exactly - it could be any package or
    just Sax itself - say, for parsing a web.config file and making changes to
    it as part of a Salt state using the py renderer.

    If I don't use salt (just import boto) from a normal python prompt, it
    works fine because xml.sax is in the Python Path because the library is not
    overridden by the zip file.

    Basically, I'm looking for any guidance to adding modules to Windows
    minions regardless of the exact package. For example, the Softlayer module
    for salt-cloud (we also use Softlayer) requires that the Softlayer python
    package be installed. Same deal - how do I get these into Windows minions?
    On Sunday, January 18, 2015 at 11:58:04 AM UTC-8, perlhoser wrote:

    Hi Tiru,

    You're right, Salt does not use xml.sax, but boto seems to use it
    extensively. While none of Salt Cloud uses boto at all, the boto_*
    execution modules in Salt do.

    Since this is a boto issue, I would check with them to see if they have
    any ideas for reliable Windows usage. I wouldn't be surprised if they've
    run across this already.

    On Sun, Jan 18, 2015 at 12:13 PM, Tiru Srikantha <tiru.sr...@gmail.com
    <javascript:>> wrote:
    I'm working on a masterless Windows setup process on EC2 and I'm having
    trouble getting boto and salt-cloud working.

    I've installed Python 2.7.9 and added the Boto module, but when I go to
    import it inside of Salt, I get:

    File "c:\Python27\lib\site-packages\boto\exception.py", line 28, in
    <module>
    import xml.sax
    ImportError: No module named sax

    I think my PYTHONPATH is set correctly:

    C:\salt>echo %PYTHONPATH%
    C:\Python27;C:\Python27\Lib;C:\Python27\Lib\site-packages

    But Salt doesn't seem to be using it:
    ['C:\\salt\\salt-2014.7.1.win-amd64\\library.zip',
    'c:\\salt\\salt-2014.7.1.win-amd64\\esky-0.9.8-py2.7.egg',
    'c:\\salt\\salt-2014.7.1.win-amd64\\jinja2-2.7.1-py2.7.egg',
    'c:\\salt\\salt-2014.7.1.win-amd64\\markupsafe-0.18-py2.7.egg',
    'c:\\salt\\salt-2014.7.1.win-am64\\msgpack_python-0.4.2-py2.7-win-amd64.egg',
    'c:\\salt\\salt-2014.7.1.win-amd64\\psutil-2.1.0-py2.7-win-amd64.egg',
    'c:\\salt\\salt-2014.7.1.win-amd64\\pyzmq-14.1.1-py2.7-win-amd64.egg',
    'c:\\salt\\salt-2014.7.1.win-amd64\\salt-2014.7.1-py2.7.egg',
    'c:\\salt\\salt-2014.7.1.win-amd64\\setuptools-1.1.6-py2.7.egg',
    'c:\\salt\\salt-2014.7.1.win-amd64\\wmi-1.4.9-py2.7.egg', 'C:\\salt\\salt-2014.7.1.win-amd64',
    *'c:\\Python27', 'c:\\Python27\\lib\\site-packages'*]

    I assume this is something to do with how the library is vendored into
    the Salt windows installer directory.

    I also tried making a .egg file and dropping it into the Salt directory,
    which had the same error until I manually shoved lib/xml/sax.pyc and
    lib/logging/config.pyc into the library.zip file.

    My use case is that I'm want to use the salt-cloud modules (
    http://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.cloud.html)
    to look up other machines in EC2 to get their IPs (rather than using a
    master and a mine) and also add the machine to load balancers/DNS etc.

    I'd like to avoid doing my own Windows fork of Salt just to add a few
    additional modules. Does anyone have any advice on how to do this? I really
    would like to be able to use additional modules with Salt, but the Windows
    packaging process seems to make that very difficult without putting the
    modules in at build time.

    Alternatively, if I wanted to make the effort, could I technically bypass
    the Windows installer entirely and install all the deps (
    https://github.com/saltstack/salt-windows-install) and python files from
    git, then just start Salt like I would on a Linux box?

    --
    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 <javascript:>.
    For more options, visit https://groups.google.com/d/optout.


    --
    "In order to create, you have to have the willingness, the desire to be
    challenged, to be learning." -- Ferran Adria (speaking at Harvard, 2011)
    --
    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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Joseph Hall at Jan 19, 2015 at 1:59 pm
    My apologies, Tiru.

    Since this is clearly an issue with Salt, would you please file an issue in
    GitHub, and ping @UtahDave?
    On Sun, Jan 18, 2015 at 11:46 PM, Tiru Srikantha wrote:

    I'm sorry, but this is entirely due to the way with which Salt packages
    the Python library into a zip file and then references it in the Windows
    client. It has nothing to do with boto exactly - it could be any package or
    just Sax itself - say, for parsing a web.config file and making changes to
    it as part of a Salt state using the py renderer.

    If I don't use salt (just import boto) from a normal python prompt, it
    works fine because xml.sax is in the Python Path because the library is not
    overridden by the zip file.

    Basically, I'm looking for any guidance to adding modules to Windows
    minions regardless of the exact package. For example, the Softlayer module
    for salt-cloud (we also use Softlayer) requires that the Softlayer python
    package be installed. Same deal - how do I get these into Windows minions?
    On Sunday, January 18, 2015 at 11:58:04 AM UTC-8, perlhoser wrote:

    Hi Tiru,

    You're right, Salt does not use xml.sax, but boto seems to use it
    extensively. While none of Salt Cloud uses boto at all, the boto_*
    execution modules in Salt do.

    Since this is a boto issue, I would check with them to see if they have
    any ideas for reliable Windows usage. I wouldn't be surprised if they've
    run across this already.

    On Sun, Jan 18, 2015 at 12:13 PM, Tiru Srikantha <tiru.sr...@gmail.com>
    wrote:
    I'm working on a masterless Windows setup process on EC2 and I'm having
    trouble getting boto and salt-cloud working.

    I've installed Python 2.7.9 and added the Boto module, but when I go to
    import it inside of Salt, I get:

    File "c:\Python27\lib\site-packages\boto\exception.py", line 28, in
    <module>
    import xml.sax
    ImportError: No module named sax

    I think my PYTHONPATH is set correctly:

    C:\salt>echo %PYTHONPATH%
    C:\Python27;C:\Python27\Lib;C:\Python27\Lib\site-packages

    But Salt doesn't seem to be using it:
    ['C:\\salt\\salt-2014.7.1.win-amd64\\library.zip',
    'c:\\salt\\salt-2014.7.1.win-amd64\\esky-0.9.8-py2.7.egg',
    'c:\\salt\\salt-2014.7.1.win-amd64\\jinja2-2.7.1-py2.7.egg',
    'c:\\salt\\salt-2014.7.1.win-amd64\\markupsafe-0.18-py2.7.egg',
    'c:\\salt\\salt-2014.7.1.win-am64\\msgpack_python-0.4.2-py2.7-win-amd64.egg',
    'c:\\salt\\salt-2014.7.1.win-amd64\\psutil-2.1.0-py2.7-win-amd64.egg',
    'c:\\salt\\salt-2014.7.1.win-amd64\\pyzmq-14.1.1-py2.7-win-amd64.egg',
    'c:\\salt\\salt-2014.7.1.win-amd64\\salt-2014.7.1-py2.7.egg',
    'c:\\salt\\salt-2014.7.1.win-amd64\\setuptools-1.1.6-py2.7.egg',
    'c:\\salt\\salt-2014.7.1.win-amd64\\wmi-1.4.9-py2.7.egg', '
    C:\\salt\\salt-2014.7.1.win-amd64', *'c:\\Python27',
    'c:\\Python27\\lib\\site-packages'*]

    I assume this is something to do with how the library is vendored into
    the Salt windows installer directory.

    I also tried making a .egg file and dropping it into the Salt directory,
    which had the same error until I manually shoved lib/xml/sax.pyc and
    lib/logging/config.pyc into the library.zip file.

    My use case is that I'm want to use the salt-cloud modules (
    http://docs.saltstack.com/en/latest/ref/modules/all/salt.
    modules.cloud.html) to look up other machines in EC2 to get their IPs
    (rather than using a master and a mine) and also add the machine to load
    balancers/DNS etc.

    I'd like to avoid doing my own Windows fork of Salt just to add a few
    additional modules. Does anyone have any advice on how to do this? I really
    would like to be able to use additional modules with Salt, but the Windows
    packaging process seems to make that very difficult without putting the
    modules in at build time.

    Alternatively, if I wanted to make the effort, could I technically
    bypass the Windows installer entirely and install all the deps (
    https://github.com/saltstack/salt-windows-install) and python files
    from git, then just start Salt like I would on a Linux box?

    --
    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/d/optout.


    --
    "In order to create, you have to have the willingness, the desire to be
    challenged, to be learning." -- Ferran Adria (speaking at Harvard, 2011)
    --
    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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.


    --
    "In order to create, you have to have the willingness, the desire to be
    challenged, to be learning." -- Ferran Adria (speaking at Harvard, 2011)

    --
    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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • David Boucha at Jan 20, 2015 at 4:25 pm
    Currently Salt is packaged for Windows by freezing python and all Salt's
    dependencies into a self contained package.
    As such, it's not real easy to add new packages except at build time.

    As you found you can often drop and egg into the frozen package location
    and that will work.

    You can definitely install Salt from source following
    https://github.com/saltstack/salt-windows-install
    That doc may be slightly out of date. Also you'll need to use nssm or some
    other tool to create salt-minion Windows service.

    I'm considering changing how Salt is installed to make it easier to user
    the system python, or at least update the salt-minion's
    copy of python, but that is still in the planning stage.
    On Sun, Jan 18, 2015 at 11:46 PM, Tiru Srikantha wrote:

    I'm sorry, but this is entirely due to the way with which Salt packages
    the Python library into a zip file and then references it in the Windows
    client. It has nothing to do with boto exactly - it could be any package or
    just Sax itself - say, for parsing a web.config file and making changes to
    it as part of a Salt state using the py renderer.

    If I don't use salt (just import boto) from a normal python prompt, it
    works fine because xml.sax is in the Python Path because the library is not
    overridden by the zip file.

    Basically, I'm looking for any guidance to adding modules to Windows
    minions regardless of the exact package. For example, the Softlayer module
    for salt-cloud (we also use Softlayer) requires that the Softlayer python
    package be installed. Same deal - how do I get these into Windows minions?
    On Sunday, January 18, 2015 at 11:58:04 AM UTC-8, perlhoser wrote:

    Hi Tiru,

    You're right, Salt does not use xml.sax, but boto seems to use it
    extensively. While none of Salt Cloud uses boto at all, the boto_*
    execution modules in Salt do.

    Since this is a boto issue, I would check with them to see if they have
    any ideas for reliable Windows usage. I wouldn't be surprised if they've
    run across this already.

    On Sun, Jan 18, 2015 at 12:13 PM, Tiru Srikantha <tiru.sr...@gmail.com>
    wrote:
    I'm working on a masterless Windows setup process on EC2 and I'm having
    trouble getting boto and salt-cloud working.

    I've installed Python 2.7.9 and added the Boto module, but when I go to
    import it inside of Salt, I get:

    File "c:\Python27\lib\site-packages\boto\exception.py", line 28, in
    <module>
    import xml.sax
    ImportError: No module named sax

    I think my PYTHONPATH is set correctly:

    C:\salt>echo %PYTHONPATH%
    C:\Python27;C:\Python27\Lib;C:\Python27\Lib\site-packages

    But Salt doesn't seem to be using it:
    ['C:\\salt\\salt-2014.7.1.win-amd64\\library.zip',
    'c:\\salt\\salt-2014.7.1.win-amd64\\esky-0.9.8-py2.7.egg',
    'c:\\salt\\salt-2014.7.1.win-amd64\\jinja2-2.7.1-py2.7.egg',
    'c:\\salt\\salt-2014.7.1.win-amd64\\markupsafe-0.18-py2.7.egg',
    'c:\\salt\\salt-2014.7.1.win-am64\\msgpack_python-0.4.2-py2.7-win-amd64.egg',
    'c:\\salt\\salt-2014.7.1.win-amd64\\psutil-2.1.0-py2.7-win-amd64.egg',
    'c:\\salt\\salt-2014.7.1.win-amd64\\pyzmq-14.1.1-py2.7-win-amd64.egg',
    'c:\\salt\\salt-2014.7.1.win-amd64\\salt-2014.7.1-py2.7.egg',
    'c:\\salt\\salt-2014.7.1.win-amd64\\setuptools-1.1.6-py2.7.egg',
    'c:\\salt\\salt-2014.7.1.win-amd64\\wmi-1.4.9-py2.7.egg', '
    C:\\salt\\salt-2014.7.1.win-amd64', *'c:\\Python27',
    'c:\\Python27\\lib\\site-packages'*]

    I assume this is something to do with how the library is vendored into
    the Salt windows installer directory.

    I also tried making a .egg file and dropping it into the Salt directory,
    which had the same error until I manually shoved lib/xml/sax.pyc and
    lib/logging/config.pyc into the library.zip file.

    My use case is that I'm want to use the salt-cloud modules (
    http://docs.saltstack.com/en/latest/ref/modules/all/salt.
    modules.cloud.html) to look up other machines in EC2 to get their IPs
    (rather than using a master and a mine) and also add the machine to load
    balancers/DNS etc.

    I'd like to avoid doing my own Windows fork of Salt just to add a few
    additional modules. Does anyone have any advice on how to do this? I really
    would like to be able to use additional modules with Salt, but the Windows
    packaging process seems to make that very difficult without putting the
    modules in at build time.

    Alternatively, if I wanted to make the effort, could I technically
    bypass the Windows installer entirely and install all the deps (
    https://github.com/saltstack/salt-windows-install) and python files
    from git, then just start Salt like I would on a Linux box?

    --
    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/d/optout.


    --
    "In order to create, you have to have the willingness, the desire to be
    challenged, to be learning." -- Ferran Adria (speaking at Harvard, 2011)
    --
    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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
    --
    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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupsalt-users @
postedJan 18, '15 at 7:13p
activeJan 20, '15 at 4:25p
posts5
users3

People

Translate

site design / logo © 2022 Grokbase