Christian Herdtweck [Wed, 6 Apr 2022 10:53:10 +0000]
Improve creation of docs
Want to have the name "pyi2ncommon" in there, not have it replaced by "src".
Realized that modules.rst is auto-created, so does not belong into git.
Christian Herdtweck [Wed, 6 Apr 2022 10:44:17 +0000]
Update deprecation warnings
Parts of arnied_wrapper will have to stay. However, simple_cnf,
mk_config and cnfline are to be removed, too.
Also make other warnings a proper reST note.
Christian Herdtweck [Wed, 6 Apr 2022 10:43:03 +0000]
Update purpose in module descriptions
After a long discussion between Tom, Plamen, and Christian about location
and form of config-related functionality, it was realized that pyi2ncommon
is not just a collection of helpers for internal use, but also an interface
for "external" users of Intra2net system code like QA. Adjust description
in spec file and doc main page accordingly.
Plamen Dimitrov [Tue, 12 Apr 2022 07:32:43 +0000]
Update mail utils folder name assumptions from Objekte to Elemente
"Gesendete Objekte" was the old name from Outlook 2003-2007 and was
changed to "Gesendete Elemente" in Outlook 2010 onwards. We aligned
ourselves with Outlook since it's the most used email client with
the IBS.
Christian Herdtweck [Fri, 1 Apr 2022 11:29:19 +0000]
Create argparse type "existing_dir[_empty]"
Programs often have a file or dir as argument, check in argparse right
away whether that actually exists. Optionally, accept an empty value to
use a default value.
Christian Herdtweck [Mon, 4 Apr 2022 15:45:14 +0000]
Clean up, remove compat with py < 3.6
Remove __future__ statements and other remainders of python2-compatibility.
Remove checks for python version <3.6, assume we are running on python 3.6
or above.
Also run a major pylint on all the code and fix lots of things, including
many typos, missing paramters, strange whitespace, "r" in front of regex
string literals, ...
However, ignore deprecated modules.
Christian Herdtweck [Mon, 4 Apr 2022 12:50:49 +0000]
Increase version to 1.7.0
Christian Herdtweck [Fri, 1 Apr 2022 14:47:59 +0000]
Little fixes found during cnfvar-api-Review
Christian Herdtweck [Tue, 5 Apr 2022 07:20:23 +0000]
Merge branch 'cnfvar-api'
Christian Herdtweck [Fri, 1 Apr 2022 14:41:42 +0000]
Review: a few fixes
functional changes:
* get to run on python < 3.8
* add missing args for shadowed functions startswith/endswith
* some more
non-functional changes:
* add some doc strings (mostly arnied_api)
* wrap very long lines
* add some whitespace to make linter happier
* fix a few typos
* remove unnecessary "object" super class
* fix api documentation
* add diagram that Samir had created to api doc
Christian Herdtweck [Fri, 1 Apr 2022 13:31:41 +0000]
Deprecate cnfvar_old and arnied_wrapper
Just via text in doc string, do not raise Warnings yet
Samir Aguiar [Sun, 15 Aug 2021 17:43:00 +0000]
Add a new cnfvar2 API
It is composed of three main modules:
- binary: wrappers around the get_ and set_cnf binaries
- model: provides Cnf and CnfList classes, which are Python
representation of cnfvars with dozens of facility methods to
manipulate them
- store: classes implemented using the repository pattern that
run queries against the arnied API or the binaries using the above
module and return CnfList instances
Samir Aguiar [Mon, 14 Feb 2022 18:51:27 +0000]
Add a Python version of arnied varlink interface
Also add as many typings as possible.
Can be easily used from within an IBS VM that has the varlink module
installed:
```
from pyi2ncommon.arnied_api import Arnied, GetCnfQuery
cnfs = Arnied.get_cnf(GetCnfQuery("USER"))
user = cnfs.vars[0]
assert user.name == "USER"
assert user.instance == 1
assert user.data == "admin"
```
Samir Aguiar [Thu, 17 Mar 2022 21:14:05 +0000]
Rename cnfvar module to cnfvar_old
The new API will replace it and we want to prevent users from being
confused about which to use.
Samir Aguiar [Mon, 23 Aug 2021 03:26:48 +0000]
Various fixes to the cnfvar module
- fix infinite loop with blank lines
- do not drop parent and comment values when normalizing
- fix error when first child begins with whitespaces
- format, restructure and document the module
Christian Herdtweck [Fri, 1 Apr 2022 11:30:44 +0000]
Ignore JetBrains IDE dir
Christian Herdtweck [Wed, 10 Nov 2021 09:31:53 +0000]
Version 1.6.7
Christian Herdtweck [Wed, 10 Nov 2021 09:29:57 +0000]
Merge branch 'logger-accept-handlers'
Christian Herdtweck [Thu, 19 Dec 2019 16:16:35 +0000]
Fix comments and spacing
Christian Herdtweck [Thu, 19 Dec 2019 16:16:20 +0000]
Add methods to more easily add handlers
Christian Herdtweck [Thu, 19 Dec 2019 16:12:20 +0000]
Create unittest for log_helper from test functions
Christian Herdtweck [Fri, 9 Aug 2019 13:19:15 +0000]
Fix a small bug in log helper
Christian Herdtweck [Fri, 9 Aug 2019 13:19:00 +0000]
Add a NullHandler if no handler is supplied to i2n logger
Christian Herdtweck [Fri, 9 Aug 2019 10:57:06 +0000]
Add option to add specified handlers to logger
Christian Herdtweck [Mon, 8 Nov 2021 15:12:46 +0000]
Merge branch 'log-read-improve'
Christian Herdtweck [Wed, 12 Dec 2018 10:02:07 +0000]
log_read: correct error message
Christian Herdtweck [Wed, 12 Dec 2018 09:54:56 +0000]
log_read: return/yield all of input args from iteration
Christian Herdtweck [Wed, 12 Dec 2018 09:49:48 +0000]
log_read: Make names of class variables clearer
Christian Herdtweck [Tue, 22 Jan 2019 09:50:41 +0000]
log_read: Fix import order and return from prepare_result
Christian Herdtweck [Tue, 22 Jan 2019 09:50:10 +0000]
log_read: create/Fix docstrings
Including fixes inspired by Plamen's review.
Christian Herdtweck [Mon, 8 Nov 2021 15:01:25 +0000]
log_read: One more check for test
Christian Herdtweck [Mon, 8 Nov 2021 14:53:58 +0000]
log_read: Deal with rare case of wrong fstat at test start
Christian Herdtweck [Mon, 8 Nov 2021 13:41:18 +0000]
log_read: Just warn when file shrinks, try reading anyway
Christian Herdtweck [Mon, 8 Nov 2021 08:26:52 +0000]
Fix get_cnf if working on local machine
get_cnf always returns latin1-encoded output, but wrapper decoded shell-output
with system-default-encoding (usually utf8). Fix that
Christian Herdtweck [Mon, 8 Nov 2021 08:24:40 +0000]
Add argparse-checker for file allowing empty
Often one needs to give as argument an existing file, so we have a check for
that, that can be used with argparse. However, sometimes you want to give
users the option to not give a filename at all, which is what this new
checker allows.
Christian Herdtweck [Mon, 8 Nov 2021 08:23:01 +0000]
Fix some whitespace and line breaks
Christian Herdtweck [Wed, 15 Sep 2021 08:07:10 +0000]
Reduce assumptions on stdout
We might be running in an environment that captures stdout
by using some replacement class. Do not fail in that case
but just disble coloring
Christian Herdtweck [Wed, 15 Sep 2021 08:05:54 +0000]
Do not assume running tests in English system
Error message might differ greatly. This will have to be
adjusted further, works now for German and English
Christian Herdtweck [Wed, 15 Sep 2021 08:04:25 +0000]
Do not re-run tests if they failed already
Christian Herdtweck [Fri, 10 Sep 2021 12:02:08 +0000]
Bump release, now version 1.6.6
Christian Herdtweck [Fri, 10 Sep 2021 11:58:40 +0000]
Merge branch 'arnied-wait-socket'
Samir Aguiar [Thu, 12 Aug 2021 21:26:25 +0000]
Use the already defined function to wait for generate
Samir Aguiar [Tue, 31 Aug 2021 22:39:04 +0000]
Improve documentation of arnied wrapper and tests
Samir Aguiar [Thu, 12 Aug 2021 12:54:14 +0000]
Add a new function to wait for arnied to be ready
Usually code depending on arnied checks whether its process is running
before proceeding, which can lead to a race condition when it is not
yet fully started. The new function makes use of a novel CLI option
in the arnied helper that blocks execution until arnied is indeed
ready to be used.
Samir Aguiar [Wed, 1 Sep 2021 01:23:04 +0000]
Fix unit tests
The dummy provider CNF variable was not in the correct form.
Also drop the TODO regarding raising an error when failing to go
online. The `run_cmd` function, which is mocked in the unit tests,
does check for the exit code of commands before returning.
Christian Herdtweck [Wed, 8 Apr 2020 15:54:51 +0000]
Add license and doc to rpm package
Failed to do this using setup.py and hacks in make_dist.py,
at least when doc and license files should not end up in
site-packages with the source code. Therefore change (and
simplify) the whole build process by re-creating
make_dist.py to just create a tarball that is compatible
with standard python spec files (like that of our QA) and
provide such a simple spec file to be used with rpmbuild.
Christian Herdtweck [Thu, 2 Sep 2021 08:03:07 +0000]
Remove superfluous doc/README
Christian Herdtweck [Thu, 25 Mar 2021 09:55:35 +0000]
Increase version to 1.6.5
Juliana Rodrigueiro [Thu, 11 Mar 2021 13:37:51 +0000]
Fix decoding on "get_cnf --json"
The get_cnf command returns its output already in utf-8 when the
json switch is enabled. However the module cnfvar assumes that
raw data is always latin1, which is the case most of the time
when using arnied commands. This patch decodes the data, as we
know it is utf-8, before calling read_cnf_json.
Another caveat however, when the language locale is set to "C"
(which is currently the standard for avocado) before vm sessions
are started, every output (latin1 or utf-8) containing non ascii
characters will have those characters omitted (not garbled,
simply missing).
Thomas Jarosch [Thu, 13 Feb 2020 15:30:10 +0000]
Increase version to 1.6.4
Christian Herdtweck [Mon, 2 Dec 2019 12:11:08 +0000]
Small fix and comment for imap mailbox
Christian Herdtweck [Thu, 5 Dec 2019 16:13:56 +0000]
Minor fix: else --> elif
Running both cases was impossible, anyway.
Christian Herdtweck [Thu, 5 Dec 2019 14:57:05 +0000]
Fix typo in Group CnfVar builder
Christian Herdtweck [Mon, 2 Dec 2019 12:12:34 +0000]
Minor improvement of comments for SimpleCnf
Plamen Dimitrov [Wed, 5 Feb 2020 00:17:11 +0000]
Replace all mentions of autotest with pyi2n-generic alternatives
The only part we keep is using the Autotest email ID used from
a custom tool 'test_data_sync' which should be updated on one
separate batch.
Thomas Jarosch [Sat, 1 Feb 2020 18:26:30 +0000]
Add support for new NIC_COMMENT field
The comment field on NICs moves from the parent NIC
to a new NIC_COMMENT cnfvar.
Christian Herdtweck [Thu, 14 Nov 2019 17:00:19 +0000]
Increase version to 1.6.3
Christian Herdtweck [Thu, 14 Nov 2019 15:24:41 +0000]
Create ImapMailbox.fetch_{mail,message}
Christian Herdtweck [Thu, 14 Nov 2019 16:22:33 +0000]
Merge branch 'mail-to-extern'
Christian Herdtweck [Thu, 14 Nov 2019 11:04:30 +0000]
Add unittest for prepare_recipients
Christian Herdtweck [Thu, 14 Nov 2019 10:49:39 +0000]
Update comments in mail validator tests
Christian Herdtweck [Thu, 14 Nov 2019 10:44:44 +0000]
Allow sending mail to external recipients.
Email sending functions had always assumed they send to local recipients.
However, with a little modification functions can be used to send to
external recipients, too.
Plamen Dimitrov [Tue, 19 Nov 2019 08:58:24 +0000]
Add validation for running arnied process for the unset_cnf function
This is the least developed arnied cnfvar function mostly because
we rarely had to unset any pre-existing cnfvar. Independently of
use cases, this function is required to validate the arnied process
is running in a similar manner to the more developed get/set functions.
Plamen Dimitrov [Thu, 14 Nov 2019 11:09:47 +0000]
Refactor the entire waiting for GENERATE to allow for more arguments
This code is completely redundant and has a much better implementation
in the more general waiting for a running program method.
Plamen Dimitrov [Thu, 14 Nov 2019 11:11:31 +0000]
Increase the available arguments for all current mk_config methods
The mk_config is a statistical hub for the way we do API calls to
the fully dynamic set_cnf bindings so it seems like a good place
to start implementing a more graspable unified cnfvar approach.
Christian Herdtweck [Tue, 5 Nov 2019 10:59:32 +0000]
Increase version to 1.6.2
Thomas Jarosch [Mon, 4 Nov 2019 16:05:03 +0000]
Remove ISDN dialin related cnfvars
It does not seem to be used in pyi2ncommon or intra2net-qa anyway.
Christian Herdtweck [Wed, 16 Oct 2019 14:00:45 +0000]
Merge branch 'drop-cnfvar-translation'
Christian Herdtweck [Wed, 16 Oct 2019 14:00:20 +0000]
Merge branch 'mkconfig-generalizations'
Plamen Dimitrov [Wed, 16 Oct 2019 08:56:26 +0000]
Drop legacy cnfvar-autotest parameter translation
Plamen Dimitrov [Fri, 4 Oct 2019 14:59:21 +0000]
Extend the port forwarding mk_config function to proper port selection
Plamen Dimitrov [Fri, 4 Oct 2019 14:53:16 +0000]
Use a better default value for the nic type of newly defined nics
Christian Herdtweck [Thu, 8 Aug 2019 09:58:11 +0000]
Increase version to 1.6
Also mention "python" in description.
Christian Herdtweck [Thu, 8 Aug 2019 09:55:02 +0000]
Merge branch 'mail-utils-improvement'
Christian Herdtweck [Mon, 15 Jul 2019 11:06:36 +0000]
Fix timezone in test for parse_mail_date
Christian Herdtweck [Mon, 15 Jul 2019 11:06:08 +0000]
Add option to parse newer EmailMessage type from mails
Sofar, parser policy was not specified, so "compat32" was used for compatibility
with python 3.2. Changing to the more modern "default" policy returns a different
type of message (EmailMessage instead of Message) that has quite some differences.
For example, EmailMessage.get(header_name) returns no longer str but a Header object.
This would break lots of code so use the old compat32 as default still.
Christian Herdtweck [Mon, 15 Jul 2019 11:04:03 +0000]
Parse email from bytes instead of text
This allows usage of other encodings than the system encoding (e.g. latin1)
Christian Herdtweck [Mon, 15 Jul 2019 11:02:19 +0000]
Create mail_utils test with latin1 encoded mail
Christian Herdtweck [Mon, 15 Jul 2019 11:00:53 +0000]
Move mail_validator tests into own test file
Christian Herdtweck [Tue, 25 Jun 2019 11:34:32 +0000]
Minor fixes for mail_utils
- update module description
- add missing docu
- add link to MailValidator and ImapMailbox docu
- correct comment
- fix wrapping of 3 lines
- remove one useless else
Christian Herdtweck [Tue, 25 Jun 2019 11:05:12 +0000]
Move MailValidator into own module
mail_utils is getting overcrowded and MailValidator is about half of it
and rather independent of the rest.
Christian Herdtweck [Fri, 7 Jun 2019 07:21:15 +0000]
Create ImapMailbox, a wrapper around python's IMAP4
Python's built-in imap class offers little convenience. Add some
of our own with this class.
Christian Herdtweck [Tue, 4 Jun 2019 07:58:41 +0000]
Create unittest for parse_mail_date
Christian Herdtweck [Tue, 4 Jun 2019 07:56:14 +0000]
Create mail_util parse_mail_date
This is only a 2-liner now but started off as a more involved function
which was cut down when I realized: it is already implemented in python.
Leave this here, still, so I do not make that mistake again (and for the
small extra convenience).
Christian Herdtweck [Tue, 4 Jun 2019 07:52:54 +0000]
Create function get_user_mail_files
Sometimes do not need to parse the mail, just need to know how many/which
files there are.
Christian Herdtweck [Tue, 23 Jul 2019 09:40:37 +0000]
Return after giving help in make_dist.py
Christian Herdtweck [Thu, 8 Aug 2019 09:53:48 +0000]
Bring back source check script
Old script was deleted a few commits ago for version 1.5
(commit
81f7f6c7a16bc5e63228996cedf8ac83f45f3717).
This is a modified version from i2n avocado source.
Christian Herdtweck [Tue, 16 Apr 2019 09:03:54 +0000]
Fix a bug in mail_utils.send_email_with_files
Implementation had assumed that isinstance(bool, int) is False. But bool
is a subclass of int, therefore logic did not work
Christian Herdtweck [Mon, 15 Apr 2019 08:09:20 +0000]
Change version to 1.5
Christian Herdtweck [Mon, 15 Apr 2019 08:09:51 +0000]
Remove outdated check script. Will bring back as adapted copy from QA code
Christian Herdtweck [Tue, 9 Apr 2019 12:20:59 +0000]
Increase version to 1.5 (alpha)
Christian Herdtweck [Tue, 9 Apr 2019 09:53:34 +0000]
Merge branch 'py3.7-ssl-certs'
Christian Herdtweck [Tue, 9 Apr 2019 08:33:23 +0000]
Take into account that certs are not issued to "localhost"
Use FQDN instead
Christian Herdtweck [Tue, 9 Apr 2019 08:20:55 +0000]
Make certificate checks optional, enable per default
Also give an option to give an extra certificate to accept as .pem
Christian Herdtweck [Tue, 9 Apr 2019 08:19:16 +0000]
Fix error type returned from failed POST
Plamen Dimitrov [Tue, 26 Mar 2019 03:53:52 +0000]
Allow HTTPS connections with self-signed certificates
We use such certificates on the web surface of the Intra2net system.
Christian Herdtweck [Tue, 9 Apr 2019 09:52:43 +0000]
Improve output of unittest
Christian Herdtweck [Tue, 9 Apr 2019 09:50:53 +0000]
Create dist for python3.7 per default (and add help)
Both Intra2net systems and avocado are now running on python3.7
Christian Herdtweck [Tue, 9 Apr 2019 09:50:11 +0000]
Fix bad end of iterator and unused variable
The StopIteration is a real error in python 3.7
Christian Herdtweck [Tue, 9 Apr 2019 09:46:04 +0000]
Merge branch 'py3.7-subprocess'