Commit Graph

347 Commits

Author SHA1 Message Date
Morgan Willcock
d7e05091a2 Remove global options from Install 2017-02-04 19:00:36 +00:00
rallytime
d5bbd91c14 Merge branch '2016.3' into 'carbon'
Conflicts:
  - conf/master
2016-09-23 17:01:17 -06:00
rallytime
52cf40db8c Merge branch '2015.8' into '2016.3'
No conflicts.
2016-09-23 08:32:47 -06:00
rallytime
7bcbf8dc36 Merge branch '2016.3' into 'carbon'
Conflicts:
  - doc/faq.rst
  - salt/modules/win_service.py
2016-09-20 10:43:55 -06:00
twangboy
fc4a03a75d Check for existing library on Windows 2016-09-20 09:31:13 -06:00
rallytime
c64e489f6f Merge branch '2015.8' into '2016.3'
No conflicts.
2016-09-19 11:22:54 -06:00
twangboy
a817aef1c2 Add windows requirements file 2016-09-16 15:43:36 -06:00
rallytime
95dbe1ade4 Merge branch '2016.3' into 'carbon'
Conflicts:
  - salt/fileserver/__init__.py
  - setup.py
  - tests/integration/modules/git.py
2016-09-14 09:15:29 -06:00
rallytime
f603757b55 Merge branch '2015.8' into '2016.3'
Conflicts:
  - tests/unit/modules/mount_test.py
  - tests/unit/states/file_test.py
2016-09-13 08:21:48 -06:00
twangboy
dc1988add5 fix download when requests not present 2016-09-07 09:59:51 -06:00
twangboy
b4479bff5f Add additional required dll's 2016-09-06 17:36:38 -06:00
Jacob Hammons
a028796eff copy spm.1 man page during setup
Refs #25213
2016-07-20 12:21:08 -06:00
Sergey Kizunov
49f89250d3 PY3 support for Windows master/minion using TCP transport
This allows masters and minions to run on Windows using Python 3. Tested
with Python 3.5.1 64-bit on Windows 7. Only the TCP transport has been
ported. It will likely not work with other transports such as ZeroMQ or
RAET without further work.

Since there were many changes necessary to make this work, here is a list
of common changes:
- Python 3 distinguishes `bytes` from `str`. In some cases `bytes` must be
used (eg read/write to binary file). In other cases `str` must be used
(eg general Salt dictionary look-ups, read/write to text file). Due to
this, there are a lot of extra uses of `salt.utils.to_bytes` in necessary
locations.
- Use `six.itervalues(varname)` instead of `varname.itervalues()`.
- In Python 2.6 and 2.7, the 'b' prefix is ignored. So instead of

```
if six.PY2:
    some_var = 'some_value'
else:
    some_var = b'some_value'
```

we choose to simply use:

```
some_var = b'some_value'

```

`salt/engine/__init__.py`:
- In Python 3, `engine.items()` will return an iterator instead of
a list. Due to this, needed to change `engine.items()[0]` to
`list(engine.items())[0]`.

`salt/minion.py`:
- `contextlib.nested` no longer supported in Python 3. Use
`contextlib.ExitStack` in this case.
- In `Minion.handle_event`, in PY3, `package` is of type `bytes` and `tag`
is of type `str`. Due to this, do all string searches via `tag` instead
of `package` since you can't search for a `str` in a `bytes` object.

`salt/payload.py`:
- Added `encoding` parameter to `Serial.loads`. See description in comments
for details.
- Added `use_bin_type` parameter to `Serial.dumps`. See description in
comments for details.
- When reading / writing local files, encode using `use_bin_type=True` and
decode using `encoding='utf-8'` to distinguish `bytes` and `str` types.

`salt/transport/frame.py`:
- Added `frame_msg_ipc`. This is used for IPC communications where it is
safe to break the wire protocol and so we encode using `use_bin_type=True`.
- Added `decode_embedded_strs`. This is used when it is not safe to break
the wire protocol (eg external communications). This will convert `bytes`
objects to `str` objects if possible. This will search for such objects
within dicts and lists.

`salt/transport/ipc.py`:
- Use `salt.transport.frame.frame_msg_ipc` to encode using
`use_bin_type=True`.
- Use `encoding='utf-8'` to decode such messages and ensure proper
distinction of `bytes` and `str` types.

`salt/transport/tpc.py`:
- Since we need to preserve the wire protocol, we don't use
`use_bin_type=True`. When decoding, we use `decode_embedded_strs` to
convert the embedded `bytes` objects that can be converted to `str`.
- `urlparse` doesn't exist in PY3. Use `urllib.parse` instead.
- `sys.maxint` not supported in PY3. Use `int((1 << 31) - 1)` instead.
Hence `sys.maxint - 1` becomes `int((1 << 31) - 2)`.

`salt/utils/__init__.py`:
- `libc = ctypes.cdll.LoadLibrary(ctypes.util.find_library("c"))` returns
`TypeError` in PY3. This is because `ctypes.util.find_library("c")`
returns `None` and in PY3 `ctypes.cdll.LoadLibrary(None)` is a
`TypeError`.
- On Windows, `salt.utils.fopen` would always read and write files in
binary mode. This has been changed for Python 3 since `bytes` must be
used for binary mode and `str` must be used for text mode and forcing
binary mode would screw things up if you want to read/write to `str`
objects. Preserved original behavior on PY2.
- For `salt.utils.fopen`, when reading and writing text files in PY3, if
an encoding is not specified, it will choose 'utf-8'.

`salt/utils/args.py`:
- In Python 3.5, every time `inspect.getargsspec` is used, a warning would
appear announcing its deprecation (it will be removed entirely in Python
3.6). Due to this, implemented our own version using
`inspect.getfullargspec`.

`salt/utils/event.py`:
- Since all functionality here is used only in IPC (the mechanism for
firing an event from minion to master is outside this file), we can break
the wire protocol and hence encode using `use_bin_type=True` and decode
using `encoding='utf-8'`.

`salt/utils/vt.py`:
- `_subprocess` is not available in PY3 under Windows, so we use an
alternate method to invoke `TerminateProcess` and `GetExitCodeProcess`.

`setup.py`:
- In PY3, `req.read(4096)` returns a `bytes` object. If you try to for
loop through it, each element is an `int` which represents an individual
byte. Trying to write an `int` to `wfh.write` raises an exception. Due to
this, use an alternate approach when writing from a
`http.client.HTTPResponse` object to file in PY3.

Signed-off-by: Sergey Kizunov <sergey.kizunov@ni.com>
2016-04-04 13:35:50 -05:00
rallytime
73d73e80c1 Merge branch '2016.3' into 'develop'
Conflicts:
  - doc/topics/releases/2015.8.4.rst
  - doc/topics/releases/2015.8.5.rst
  - doc/topics/thorium/index.rst
  - salt/cloud/clouds/opennebula.py
  - salt/engines/thorium.py
  - salt/loader.py
  - salt/modules/archive.py
  - salt/modules/boto_vpc.py
  - salt/modules/data.py
  - salt/modules/reg.py
  - salt/pillar/mysql.py
  - salt/runners/cache.py
  - salt/states/archive.py
  - salt/states/cron.py
  - salt/states/file.py
  - salt/states/glance.py
  - salt/states/reg.py
  - salt/thorium/__init__.py
  - salt/thorium/check.py
  - salt/thorium/file.py
  - salt/thorium/reg.py
  - salt/utils/jid.py
  - salt/utils/parsers.py
  - setup.py
2016-02-12 14:38:50 -07:00
Colton Myers
076b49a4ca Merge remote-tracking branch 'upstream/2015.8' into merge-forward-2016.3
Conflicts:
    README.rst
    doc/conf.py
    doc/ref/index.rst
    doc/ref/proxy/all/salt.proxy.ssh_sample.rst
    doc/topics/installation/rhel.rst
    doc/topics/releases/2015.8.4.rst
    doc/topics/tutorials/states_pt5.rst
    salt/cloud/clouds/ec2.py
    salt/cloud/clouds/opennebula.py
    salt/config/__init__.py
    salt/modules/boto_dynamodb.py
    salt/modules/boto_ec2.py
    salt/modules/boto_elasticache.py
    salt/modules/boto_elb.py
    salt/modules/boto_iam.py
    salt/modules/boto_rds.py
    salt/modules/boto_sns.py
    salt/modules/boto_sqs.py
    salt/modules/dracr.py
    salt/modules/git.py
    salt/modules/mine.py
    salt/modules/systemd.py
    salt/modules/win_pkg.py
    salt/modules/yumpkg.py
    salt/pillar/__init__.py
    salt/states/git.py
    salt/states/rabbitmq_vhost.py
    salt/states/saltmod.py
    salt/utils/pkg/rpm.py
    setup.py
    tests/unit/modules/systemd_test.py
    tests/unit/states/rabbitmq_vhost_test.py
2016-02-11 22:33:49 -07:00
rallytime
742d0a6b04 Change all relevant Boron references to 2016.3.0
And more Boron deprecation warnings to Carbon
2016-02-10 15:45:28 -07:00
Justin Findlay
ae10c71b6b setup.py: remove Boron deprecated code 2016-02-10 11:33:41 -07:00
Justin Findlay
7bfb28c5db Revert "setup.py: remove Boron deprecated code" 2016-02-10 11:27:08 -07:00
twangboy
7decec2cae Backport uname fix from #30951 2016-02-08 13:20:27 -07:00
Mike Place
dd57535a87 Merge pull request #30951 from skizunov/develop2
Added Windows master related scripts
2016-02-08 11:59:34 -07:00
Tom X. Tobin
ca3bbced33 Fix missing salt.1 man page in setup.py
setup.py wasn't installing the salt.1 man page; downstream packages
using setup.py to build ended up with salt.1 missing.
2016-02-05 16:23:30 -05:00
Sergey Kizunov
b10ef84279 setup.py won't run on Windows
Fixed an issue where setup.py will not run at all in Windows due to
the script attempting to invoke `os.uname()` which isn't supported on
Windows.

Signed-off-by: Sergey Kizunov <sergey.kizunov@ni.com>
2016-02-05 15:08:17 -06:00
Sergey Kizunov
afca3d6733 Added Windows master related scripts
Added the following scripts to Windows installations:
- salt
- salt-key
- salt-master
- salt-run

Signed-off-by: Sergey Kizunov <sergey.kizunov@ni.com>
2016-02-05 15:08:01 -06:00
Benjamin Drung
089c869ec3 Make build reproducible
The build is not reproducible because it embeds the build time. Embed
the date of the last modification to the source code instead (in case it
is provided via the SOURCE_DATE_EPOCH environment variable).

See the SOURCE_DATE_EPOCH specification for details:
https://reproducible-builds.org/specs/source-date-epoch/
2016-02-05 10:36:19 +01:00
Justin Findlay
b03f95bf0f setup.py: remove Boron deprecated code 2016-02-04 14:44:16 -07:00
Benjamin Drung
20e79981e1 Fix typo preferrably -> preferably 2016-02-04 12:51:38 +01:00
Thomas S Hatch
b563e227ca Add thorium roots to setup.py 2016-02-03 18:34:16 -07:00
Thomas S Hatch
f126f2011a Add thorium roots to setup.py 2016-02-02 10:49:23 -07:00
Hamza Sheikh
bb599a61a2 Fix indent in setup.py 2016-01-25 15:37:06 -08:00
Jorge Schrauwen
701b240224 fix indent 2016-01-23 14:04:13 +00:00
Jorge Schrauwen
8417f8da08 drop augeas as libaugeas is a pain to patch 2016-01-23 14:02:59 +00:00
Jorge Schrauwen
83b6935ab0 including said modules, would probably be a good idea too 2016-01-23 13:32:18 +00:00
Pedro Algarvio
cc3219fcde Don't install futures under Python 3 and above 2015-10-18 09:44:54 +01:00
Colton Myers
35425b14ad Merge remote-tracking branch 'upstream/2015.5' into merge-forward-2015.8
Conflicts:
    doc/man/salt-api.1
    doc/man/salt-call.1
    doc/man/salt-cloud.1
    doc/man/salt-cp.1
    doc/man/salt-key.1
    doc/man/salt-master.1
    doc/man/salt-minion.1
    doc/man/salt-run.1
    doc/man/salt-ssh.1
    doc/man/salt-syndic.1
    doc/man/salt-unity.1
    doc/man/salt.1
    doc/man/salt.7
    salt/modules/pip.py
    salt/states/user.py
2015-10-07 12:06:12 -06:00
Dennis Harper
3e08d3de8a fix for: https://github.com/saltstack/salt/issues/27373
Setup::DownloadWindowsDlls is downloading and writing the file as
a text not a binary file.

When creating the file handle to write the binary after being download from salt's
dependency repo, the file handle was being created with just the 'write' attribute,
however it also needs the 'binary' attribute.

Change-Id: I2f67d27ee847cd7808a78cd5ec0b2151d6a0c0e7
2015-10-05 11:51:29 -06:00
Dennis Harper
cc391b6862 fix for: https://github.com/saltstack/salt/issues/27373
Setup::DownloadWindowsDlls is downloading and writing the file as
a text not a binary file.

When creating the file handle to write the binary after being download from salt's
dependency repo, the file handle was being created with just the 'write' attribute,
however it also needs the 'binary' attribute.

Change-Id: I2f67d27ee847cd7808a78cd5ec0b2151d6a0c0e7
2015-09-28 15:45:30 -05:00
Pedro Algarvio
10a9189d83 Merge remote-tracking branch 'upstream/2015.8' into hotfix/merge-forward-develop 2015-09-06 12:42:58 +01:00
C. R. Oldham
acc73fc546 Add salt-proxy to setup.py so it gets installed. 2015-09-04 12:05:14 -06:00
Colton Myers
307d3d05a4 Merge remote-tracking branch 'upstream/2015.8' into merge-forward-develop
Conflicts:
    doc/man/salt.7
    salt/modules/yumpkg.py
2015-09-03 14:24:45 -06:00
Jacob Hammons
701f47a658 Added rst source for salt-proxy man page, added build and copy lines for this man page to doc/conf.py and setup.py
Added salt-proxy release notes topic
Added note to pip state for Refs #21845
Regenerated and versioned man pages
2015-09-01 17:09:35 -06:00
Pedro Algarvio
58df84e0d1 Revert "setup.py: remove raw string formatting"
This reverts commit b6c732219c.

We actually need the `repr()` version of the object.

Fixes #26774
2015-08-31 12:13:37 +01:00
Pedro Algarvio
2188867b3d Revert "We need the repr() for the version tuple."
This reverts commit 03af591129.
2015-08-31 12:10:53 +01:00
Colton Myers
1bbe45538e Merge remote-tracking branch 'upstream/2015.8' into merge-forward-develop
Conflicts:
    salt/cloud/__init__.py
    salt/modules/smartos_vmadm.py
    salt/utils/s3.py
    setup.py
2015-08-28 16:44:08 -06:00
Pedro Algarvio
03af591129 We need the repr() for the version tuple. 2015-08-28 17:42:08 +01:00
Pedro Algarvio
3f30d2a135 Use the correct names 2015-08-28 01:25:48 +01:00
Pedro Algarvio
f041653746 Handle SPM paths in the setup script 2015-08-28 01:22:14 +01:00
Erik Johnson
b6c732219c setup.py: remove raw string formatting 2015-08-26 23:26:07 -05:00
Pedro Algarvio
60c5d16330 One more missed typo 2015-08-19 19:43:37 +01:00
Colton Myers
73282d51cc Merge remote-tracking branch 'upstream/2015.8' into merge-forward-develop
Conflicts:
    salt/cli/daemons.py
    salt/master.py
    salt/minion.py
    salt/modules/gpg.py
    salt/modules/pw_group.py
    salt/utils/http.py
    setup.py
    tests/unit/modules/schedule_test.py
2015-08-19 11:29:45 -06:00
Colton Myers
e57f767244 Merge pull request #26439 from basepi/merge-forward-2015.8
[2015.8] Merge forward from 2015.5 to 2015.8
2015-08-19 10:39:04 -06:00