| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
Adds a general manpage for the sos command that then points to the
available components.
Renames sosreport.1 to sos-report.1 to match the component style, and
then symlinks sosreport.1 to it.
Adds a symlink from sos-collector.1 to sos-collect.1.
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
Adds the manpage from sos-collector to the tree as 'sos-collect', and
updates the instances of 'sos-collector' to 'sos collect' within the
manpage.
Additionally updates the man page to include newly available options.
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
|
|
|
|
| |
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
|
|
|
|
|
|
|
| |
Various fixups for PEP8, PEP257, and unused imports as highlighted by
flake8.
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Moves the functions from `SoSHost` into `Policy`, and adjusts the calls
in `SoSNode` appropriately.
Adds a `pkg_version` method to `PackageManager` to satisfy the version
checking requirements that had previously been using `SoSHost`.
Finally drops the sos/collector/hosts directory from the tree as it is
no longer used.
At this point, `sos collect` should be able to be run on any
distribution that has a defined `Policy`. Note that new policies will
need to specify 2 new class attrs, `sos_pkg_name` and `sos_bin_path` in
order for them to be supported as well.
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Rather than load a `SoSHost` instance, `SoSNode` will now load a
`Policy` that is determined by the content of `/etc/os-release` on the
remote node, as this is a standardized file for Linux-based systems and
allows for reliable identification of the host.
Each per-node policy will load the host-side package information for use
by collector in determining cluster profile and sos capabilities.
This per-node policy will not however load an `InitSystem()` or a
`ContainerRuntime()`.
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
When loading a policy, there is now support for a `remote_exec`
parameter, which should be an ssh command, to which will be appended
`PackageManager` related commands so that collector can get package data
off of the remote nodes, without having to reimplement a subset of
`PackageManager` itself.
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
|
|
|
|
|
|
|
|
|
| |
Exposes the `init` and `probe_runtime` parameters of `Policy` to all
existing vendor-defined policies. This will allow collector to replace
`SoSHost` with `Policy` while not loading the local system's init system
and container runtime information.
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Updates the `check()` method within `Policy` to allow consumers to
specify a `remote` parameter that can be used in place of the locally
available files.
This is the first step in merging `SoSHost` from collector with the
standard `Policy` which is far better defined.
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
|
|
|
|
|
|
|
|
|
| |
We should not have any exceptions to --batch being non-interactive, so
in the event that a user would need a password but fails to provide one
alongside the --batch option, it should be expected that the run will
fail, rather than stop to collect the password.
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
|
|
|
|
| |
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes `sos collect --list-options` to actually display known cluster
options, as this was initially lost/overlooked in the move from a
standalone utility to sos-4.0 integration.
Additionally, only setup a log file if none of the known `list*` options
are set for any component.
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, the ovirt (and family) cluster profile would attempt to set
a global SSH key if the ovirt-generated key was locally available by
changing the options entry for ssh_key. This no longer worked since
decoupling the shared dict, so instead create a new mechanism by which
clusters may set this.
It may prove necessary in the future to extend this functionality to
arbitrary settings, however for now I do not see that being common
place.
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
|
|
|
|
|
|
|
|
| |
Moves the update of options for a node based on a cluster profile out of
`Cluster()` and into `SoSNode()`, since the commons dict is not a shared
instance.
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
|
|
|
|
|
|
|
|
|
| |
Since moving away from a shared dict configuration, we need to do the
initial steps of displaying the disclaimer, prompting for input, and
connecting to the master to determine a cluster type in a slightly
different order.
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Moves archive setup and cleanup directly into `SoSComponent()`, then has
`SoSCollector` utilize the class rather than manually creating the
archive at the end of a run. `SoSReport()` has been updated where needed
to leverage the new location of `cleanup()`.
This also adds encryption options to `SoSCollector()` to encrypt the
final archive. It may prove later than this option should also (or
instead) pass the encryption option to the sosreport runs that occur on
the hosts.
Note that this commit marks the point from which functional, complete,
runs of `sos collect` are expected to run without error and result in a
tarball of one or more collected sosreports.
Resolves: #1988
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
|
|
|
|
|
|
|
|
|
| |
Moves the actual workings of SoSCollector() into an execute() method to
be called by the sos binary. The initialization of SoSCollector now just
handles policy and logging setup, and option validation. All connections
to nodes and further command execution is now gated behind execute()
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Moves the `collect` component away from using the Configuration class
and merges relevant options into the SoSOptions framework, whereas other
options are made into either class attrs or part of a 'commons' dict
similar to what we do in `report`.
At this point, `sos collect` has basic discovery functionality, meaning
that a user can run it locally or point it to a master node via
`--master` and get a returned list of nodes that would be collected
from. However, collection is likely to fail even if the remote command
execution works.
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
|
|
|
|
|
|
|
| |
Rather than create multiple loggers, transition the sos-collector code
to instead use the logger created by SoSComponent() initialization.
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As part of moving away from the Configuration() approach, move the
loading of support host and cluster types directly into SoSCollector().
Again, `sos collect` is not expected to be functional as of this commit,
these are iterative updates to move towards that goal. Similarly, it is
still desired that by the end of this patch series, "host types" are
really just `Policy()` instances.
Related: #1988
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit represents the first import of the sos-collector project
into sos natively for 4.0. It is not expected to be functional as of
this commit.
A minimum integration has been done at this point - namely tying
SoSCollector() as a SoSComponent() subclass, and hooking up the parser
functions.
SoSCollector will load a policy in the same way as 'sos report', and
should use the same logging methods, which will be done in a future
commit in this series.
As a divergence from the standalone sos-collector project, this
integration aims to hook in host detection with the existing Policy
model provided by sos. Additionally, we should be able to drop the
Configuration dict-subclass approach by the time this series is ready
for merge.
Related: #1988
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
Fixes a unittest failure due to an attempt to pass print() a `file`
keyword for Red Hat, which is no longer accepted in python3
Additionally fixes 2 string related errors in the test suite since
changing from python2 to python3.
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
Collect data of "insights-client --offline" into
sos_commands/insights/insights-client-dump directory.
Resolves: #2030
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently it checks for the existance of systemd using two
different directories depending on the distro used. Updating
systemd trigger to handle the detection of checking for
systemd more reliably and generically.
Reference:
https://github.com/systemd/systemd/blob/master/src/libsystemd/sd-daemon/sd-daemon.c#L598-L604
Closes: #2013
Resolves: #2029
Signed-off-by: Heather Lemon <heather.lemon@canonical.com>
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Substitute sensitive informations about oidc
found in landscape service configuration file.
From release 19.10, Landscape can use OpenID-Connect
(OIDC) to authenticate users. To enable OpenID-Connect
support, please add oidc-issuer, oidc-client-id and
oidc-client-secret to /etc/landscape/service.conf in
the [landscape] section.
Reference:
https://docs.ubuntu.com/landscape/en/onprem-auth#openid-connect-support
Closes: #2023
Resolves: #2025
Signed-off-by: Eric Desrochers <eric.desrochers@canonical.com>
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
| |
List of ClariiOn IP addresses should be provided via
-k navicli.ipaddrs plugopt, as a space separated list.
Closes: #405
Resolves: #2020
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
Signed-off-by: Bryan Quigley <bryan.quigley@canonical.com>
|
|
|
|
|
|
|
| |
Resolves: #2022
Signed-off-by: Arif Ali <arif.ali@canonical.com>
Signed-off-by: Bryan Quigley <bryan.quigley@canonical.com>
|
|
|
|
|
|
|
|
|
|
| |
Uses ndctl, daxctl, and ipmctl utilities
Closes: #1398
Resolves: #2021
Signed-off-by: Steve Scargall <steve.scargall@intel.com>
Signed-off-by: Bryan Quigley <bryan.quigley@canonical.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Make add_copy_spec & add_cmd_output method
to accept a list.
* Log directory "/var/log/landscape-server" is
now fully deprecated. Nowadays, all supported
versions are logging inside "/var/log/landscape".
Resolves: #2012
Signed-off-by: Eric Desrochers <eric.desrochers@canonical.com>
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
Mostly unused import or missing variables.
Including 1 mistyped variable by me.
Resolves: #2011
Signed-off-by: Bryan Quigley <bryan.quigley@canonical.com>
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
|
|
|
|
|
|
| |
Resolves: #2006
Signed-off-by: Bryan Quigley <bryan.quigley@canonical.com>
|
|
|
|
|
|
|
|
|
|
| |
This was used either to
* get the print function
* get the with function (for py2.5)
Resolves: #2005
Signed-off-by: Bryan Quigley <bryan.quigley@canonical.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Updates setup.py to reflect project changes with 4.0, thus allowing the
'python setup.py install' checks to run normally.
Removes futures from requirements.txt, as futures is packaged with
python 3.4 and newer, and sos no longer supports python2. In that vein,
also removes the pytohn-2.7 test from the travis configuration.
Resolves: #2004
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
|
|
|
|
|
|
| |
Removes an extraneous import identified by LGTM
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
|
|
|
|
|
|
|
| |
Updates the test script `simple.sh` used by Travis to use the new `sos`
binary with the `report` subcommand.
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
|
|
|
|
|
|
| |
Consolidated PEP8 fixes following reorganization and redeisgn work.
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
Adds support to the parser to allow aliases for subcommands in the
parser. At the moment, this only applies to `report`, with the 'rep'
shorthand. This is however intended for further 4.0 use via the
integration of sos-collector and soscleaner. For example, invoking 'sos
clean' and 'sos cleaner' would both be possible.
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
|
|
|
|
|
|
| |
Moves the HTML/JSON reporting bits under sos/report.
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We need to carry a `sosreport` binary for some time to allow for end
users and downstreams to adjust to the new binary. It was hoped
originally that the old `sosreport` binary could be maintained in place
and simply provide the older set of functionality.
This has proven to not be possible givent he overhaul of the options
handling that allows us to have multiple subcommands. So while we will
still ship an `sosreport` binary, and it will be locked to `report`
functionality, it is now a simple redirection script that also makes the
user aware of the new `sos` binary.
Closes: #1986
Resolves: #1993
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
|
|
|
|
|
|
| |
Since sos-4.0 is py3 only, set the interpreset of the binary as such
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
|
|
|
|
|
|
|
| |
Adds the `desc` class attr to SoSReport() for use by the help text when
`sos --help` is run.
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
|
|
|
|
|
|
|
| |
When loading from a config file, ensure that verbosity is set to and
integer rather than a string.
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
|
|
|
|
| |
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
|
|
|
|
|
|
|
|
| |
Removes an extraneous setting of self.sys_tmp, which is now handled via
`SoSComponent`. This was getting overridden to `None` which was causing
the final archive creation to fail.
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
|
|
|
|
|
|
|
| |
For python3, calling `.keys()` on a dict no longer returns a list, so we
need to explicitly make it a list of values to behave as expected.
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Moves SoSReport() from a standalone class to a subclass of
SoSComponent() in order to take advantage of the new 4.0 redesign.
This commit also pulls out methods that were previously transitioned to
other places, e.g. logging setup moving from SoSReport() to the base
SoSComponent() class.
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
|
|
|
|
| |
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
|
|
|
|
|
|
|
|
|
| |
For the 3.x line, many classes subclassed `object` directly, in order to
use the 'new-style' objects introduced with python3, while still
maintaining python2 functionality. As sos-4.0 is python3 only, we no
longer need to do this.
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
|
|
|
|
|
|
|
|
| |
Moving the `_sos_ definition wrapper for gettext into utilities proved
to be the wrong direction, so this moves it back into sos/__init__.py in
order to preserve the ability to properly import it elsewhere.
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Adds Policy loading into `SoSComponent()` so that any subcommand can, if
it needs it, have policies loaded consistenly. This is controlled via
the `load_policy` class attr, which defaults to True. Future subcommands
that do not need to have a policy loaded (E.G. the planned `info`
command), can simply set this to False in order to skip this step.
Moves `SoSComponent()` out of sos/__init__.py and into sos/component.py
to ease import conflicts arising from policy loading.
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
|