On Debian 8 (jessie), salt report these grains when lsb-release is
installed:
* os: Debian
* os_family: Debian
* osarch: amd64
* oscodename: jessie
* osfinger: Debian-8
* osfullname: Debian
* osmajorrelease: 8
* osrelease: 8.2
* osrelease_info: [8, 2]
When lsb-release is not installed, these grains are reported
* os: Debian GNU
* os_family: Debian GNU
* osarch: x86_64
* oscodename: Debian GNU
* osfullname: Debian GNU
* osrelease: 8
* osrelease_info: [8]
The previous salt 2015.5.3 release report these grains when
lsb-release is not installed:
* os: Debian
* os_family: Debian
* osarch: amd64
* oscodename:
* osfullname: Debian GNU/Linux
* osrelease: 8.2
* osrelease_info: [8, 2]
If lsb-release is not installed, /etc/os-release will be queried to
retrieve the operating system information. The regular expression that
parses /etc/os-release is too strict and matches only "Debian GNU" of
"Debian GNU/Linux" from the NAME field.
So follow the os-release file format specification and accept all valid
UTF-8 characters. Also do not convert the parameter names to lower-case
(for matching) since the specification defines all parameters in capital
letters.
Then salt will report these grains without lsb-release installed:
* os: Debian
* os_family: Debian
* osarch: amd64
* oscodename: Debian GNU/Linux 8 (jessie)
* osfullname: Debian GNU/Linux
* osrelease: 8
* osrelease_info: [8]
`cls.instance_map` was growing unbounded. This was because
`io_loop.close()` was invoked before `stream.close()`. The stategy used
to fix this issue was discussed in pull request #28530 and can be
summarized as follows:
The `close()` method on the async object will be called if it exists.
This will be called before the `io_loop.close()` to give the async object
the opportunity to close its stream. The del of the async object will
continue to happen after io_loop.close(). This is to maintain the fix
from pull request #27343.
Per file change details:
salt/utils/async.py:
- Implemented the close logic described above.
salt/transport/ipc.py:
- Ensured that `close()` may be invoked more than once safely.
- In IPCServer, `self.stream` was never actually used. Removed
references to it to avoid confusion.
salt/transport/zeromq.py:
- Ensured that `close()` may be invoked more than once safely.
salt/transport/tcp.py:
- Ensured that `close()` may be invoked more than once safely.
- Changed `destroy()` methods to `close()` methods since they involved
a stream that should be closed before `io_loop.close()`.
- In SaltMessageClient, added more checks for `self._closing`. This
makes exit cleaner by not attempting to reconnect while closing.
- Removed the code associate with pull request #28113. This code is
no longer needed now that the stream is closed before the io_loop.
Signed-off-by: Sergey Kizunov <sergey.kizunov@ni.com>
No checking was being done when packages failed to build, the state
would just return a True result. This adds a post-build check to see if
any of the desired packages are not present, and returns a False result
if the desired packages are not present.
Additionally, this fixes some conditions where temp dirs are not cleaned
up when builds fail, and writes the build logs under
/var/log/salt/pkgbuild (configurable with a new "log_dir" parameter),
and includes the paths of the log files in the return dict rather than
including the entire contents of the log file in the changes dict. This
will make the state results much easier to read.