pyi2ncommon
5 years agoUpdate version to 1.3 v1.3
Christian Herdtweck [Wed, 24 Oct 2018 09:51:37 +0000]
Update version to 1.3

5 years agoUse HTTP firewall ruleset option starting from I2N release 6.5.0
Plamen Dimitrov [Tue, 30 Oct 2018 15:12:27 +0000]
Use HTTP firewall ruleset option starting from I2N release 6.5.0

5 years agoFix encoding issue when building rpm
Christian Herdtweck [Wed, 24 Oct 2018 15:30:27 +0000]
Fix encoding issue when building rpm

This issue never occured in regular shells because usually LOCALE and
system encoding and similar is set.

5 years agoAdd CONTRIBUTING guide with rules for contributors
Christian Herdtweck [Wed, 24 Oct 2018 14:40:22 +0000]
Add CONTRIBUTING guide with rules for contributors

5 years agoMake debug print in test optional
Christian Herdtweck [Wed, 24 Oct 2018 13:18:52 +0000]
Make debug print in test optional

5 years agoFix units and threshold for log read test
Christian Herdtweck [Wed, 24 Oct 2018 13:11:27 +0000]
Fix units and threshold for log read test

5 years agoFix cnf var unit test: cnf lines can have different order
Christian Herdtweck [Wed, 24 Oct 2018 13:09:03 +0000]
Fix cnf var unit test: cnf lines can have different order

5 years agoMerge branch 'autotest-migration' into master
Plamen Dimitrov [Mon, 5 Nov 2018 08:58:14 +0000]
Merge branch 'autotest-migration' into master

This branch migrates all utilities originally developed for Autotest but
considered generalizable beyond its scope and useful for other projects
requiring python bindings for I2N related functionality.

Any future improvement and refactoring on the contributed modules will
be done here and made available for client code including Autotest.

5 years agoInclude the cnfline subpackage in the setuptools script
Plamen Dimitrov [Sun, 30 Sep 2018 05:20:10 +0000]
Include the cnfline subpackage in the setuptools script

5 years agoAvoid creating unclean debug directories during build cnfvar unit tests
Plamen Dimitrov [Tue, 16 Oct 2018 19:28:21 +0000]
Avoid creating unclean debug directories during build cnfvar unit tests

5 years agoRemove arnied utility stub now that the actual wrapper is available
Plamen Dimitrov [Wed, 26 Sep 2018 15:20:53 +0000]
Remove arnied utility stub now that the actual wrapper is available

5 years agoBackport some subprocess py3.5+ functionality for older python versions
Plamen Dimitrov [Thu, 4 Oct 2018 04:45:32 +0000]
Backport some subprocess py3.5+ functionality for older python versions

The main platform using these utilities only supports py3.3 making
this extra effort necessary for a seamless caller experience.

5 years agoRestrict the logging to pyi2ncommon namespace
Plamen Dimitrov [Tue, 23 Oct 2018 07:58:13 +0000]
Restrict the logging to pyi2ncommon namespace

The logging for the entire library can be managed through its
root logger and thus of all migrated functionality.

5 years agoUse the correct sourcing for all added unit tests
Plamen Dimitrov [Tue, 23 Oct 2018 07:58:26 +0000]
Use the correct sourcing for all added unit tests

5 years agoAdapt all internal imports in relative fashion
Plamen Dimitrov [Wed, 26 Sep 2018 15:25:19 +0000]
Adapt all internal imports in relative fashion

We were modifying the system path before but now we can use
cleaner importing approach.

5 years agoAdd GPLv2 licensing headers to all migrated utilities
Plamen Dimitrov [Sun, 23 Sep 2018 16:45:39 +0000]
Add GPLv2 licensing headers to all migrated utilities

5 years agoMigrate utilities from the autotest-intra2net repo
Plamen Dimitrov [Sun, 23 Sep 2018 16:27:00 +0000]
Migrate utilities from the autotest-intra2net repo

5 years agoUse the system independent null device provided by python
Plamen Dimitrov [Fri, 15 Jun 2018 18:12:12 +0000]
Use the system independent null device provided by python

5 years agoConvert configs to bytes to make some unit tests work with cnfvar
Plamen Dimitrov [Fri, 15 Jun 2018 18:11:44 +0000]
Convert configs to bytes to make some unit tests work with cnfvar

5 years agoUnify the cnf reading API to bytes argument and returned str
Plamen Dimitrov [Fri, 15 Jun 2018 18:02:44 +0000]
Unify the cnf reading API to bytes argument and returned str

Also fix byte usage in config preparation with the above assumption.

5 years agoUpdate library description, remove autotest
Christian Herdtweck [Tue, 9 Oct 2018 08:15:49 +0000]
Update library description, remove autotest

5 years agoFix iter_helper import and test
Christian Herdtweck [Tue, 9 Oct 2018 07:44:32 +0000]
Fix iter_helper import and test

5 years agoBring back call helpers
Christian Herdtweck [Mon, 8 Oct 2018 07:44:02 +0000]
Bring back call helpers

Were not used sofar but will be extendend and used again by autotest code

5 years agoMerge branch 'zip-stream-test'
Christian Herdtweck [Mon, 8 Oct 2018 07:39:38 +0000]
Merge branch 'zip-stream-test'

5 years agoFix error wrapping stdout when redirecting
Christian Herdtweck [Thu, 24 May 2018 10:29:49 +0000]
Fix error wrapping stdout when redirecting

In some cases (e.g. redirecting stdout to shell), the automatic determination
in ZipFile constructor whether its file argument can seek() and tell() fails.
stdout seems to support both but returns bogus values for tell(), resulting
in negative sizes when writing the archive's end record.

Provide a fix with additional arg force_wrap

Also ensure that CRCs are always correct as suggested in python docs and
stackoverflow

5 years agoSimplify imports in zip_stream and add comments
Christian Herdtweck [Wed, 23 May 2018 10:36:03 +0000]
Simplify imports in zip_stream and add comments

5 years agoCreate unittest for zip_stream
Christian Herdtweck [Wed, 23 May 2018 10:35:02 +0000]
Create unittest for zip_stream

Only runs in python3 (zipfile35 could be made py2-compatible by importing
print() and removing PyZipFile, but also have trouble with byte sizes in
struct.pack)

5 years agoCreate unittest for argpars_helpers
Christian Herdtweck [Fri, 15 Jun 2018 09:06:26 +0000]
Create unittest for argpars_helpers

5 years agoCreate new arparse_helpers with NonExitingParser and existing_file
Christian Herdtweck [Fri, 15 Jun 2018 09:06:02 +0000]
Create new arparse_helpers with NonExitingParser and existing_file

5 years agoCreated unittest for iter_helpers
Christian Herdtweck [Fri, 22 Jun 2018 12:09:49 +0000]
Created unittest for iter_helpers

5 years agoCreate iter_helper interesting_repetition
Christian Herdtweck [Fri, 22 Jun 2018 12:09:30 +0000]
Create iter_helper interesting_repetition

5 years agoMerge clean-up branch
Christian Herdtweck [Mon, 8 Oct 2018 07:29:39 +0000]
Merge clean-up branch

5 years agoUpdate README
Christian Herdtweck [Tue, 2 Oct 2018 08:37:00 +0000]
Update README

5 years agoFix comments in check.sh
Christian Herdtweck [Tue, 2 Oct 2018 08:36:50 +0000]
Fix comments in check.sh

5 years agoMention autotest in setup.py, update template files
Christian Herdtweck [Tue, 2 Oct 2018 08:36:33 +0000]
Mention autotest in setup.py, update template files

5 years agoFix whitespace in comments in template
Christian Herdtweck [Tue, 2 Oct 2018 08:35:55 +0000]
Fix whitespace in comments in template

5 years agoFinally break ties with python2
Christian Herdtweck [Tue, 2 Oct 2018 08:35:06 +0000]
Finally break ties with python2

5 years agoRemove unused test_helpers
Christian Herdtweck [Tue, 2 Oct 2018 08:02:54 +0000]
Remove unused test_helpers

5 years agoReplace only usage of test_helpers
Christian Herdtweck [Tue, 2 Oct 2018 08:01:12 +0000]
Replace only usage of test_helpers

5 years agoRemove unused call_helpers
Christian Herdtweck [Tue, 2 Oct 2018 08:00:54 +0000]
Remove unused call_helpers

5 years agoRemove deprecated log reader utility
Christian Herdtweck [Mon, 8 Oct 2018 07:27:14 +0000]
Remove deprecated log reader utility

Use log_read instead

5 years agoRemove old unused file helpers
Christian Herdtweck [Mon, 8 Oct 2018 07:26:43 +0000]
Remove old unused file helpers

Half-baked re-implementation of psutils, no good

5 years agoFix name of project in doc config
Christian Herdtweck [Fri, 3 Aug 2018 13:52:56 +0000]
Fix name of project in doc config

5 years agoCreate sphinx docu only of src, not of test
Christian Herdtweck [Fri, 3 Aug 2018 13:45:55 +0000]
Create sphinx docu only of src, not of test

5 years agoUpdate copyright in sphinx docu
Christian Herdtweck [Fri, 3 Aug 2018 13:45:32 +0000]
Update copyright in sphinx docu

5 years agoCorrect formatting of comments in template, add some more text
Christian Herdtweck [Fri, 3 Aug 2018 13:28:09 +0000]
Correct formatting of comments in template, add some more text

5 years agoUnify license, copyright and author information
Christian Herdtweck [Fri, 3 Aug 2018 13:27:44 +0000]
Unify license, copyright and author information

5 years agoFixed one error and some whitespace found by pycharm
Christian Herdtweck [Mon, 18 Jun 2018 08:17:49 +0000]
Fixed one error and some whitespace found by pycharm

5 years agoMake a note in file_helpers to use psutils instead of re-implementing it
Christian Herdtweck [Fri, 15 Jun 2018 11:15:55 +0000]
Make a note in file_helpers to use psutils instead of re-implementing it

5 years agoMerge branch 'install-subdir' v1.2
Christian Herdtweck [Tue, 22 May 2018 10:56:17 +0000]
Merge branch 'install-subdir'

5 years agoSkip CnfVar unittests
Christian Herdtweck [Tue, 22 May 2018 10:33:30 +0000]
Skip CnfVar unittests

These tests seem to never have worked

5 years agoClarify that disc_filler is no unittest
Christian Herdtweck [Tue, 22 May 2018 10:11:34 +0000]
Clarify that disc_filler is no unittest

5 years agoReplace non-ascii char in cnfvar, import print from future
Christian Herdtweck [Tue, 22 May 2018 10:11:18 +0000]
Replace non-ascii char in cnfvar, import print from future

5 years agoRename cnfvar unittest so it is actually being found and used
Christian Herdtweck [Tue, 22 May 2018 10:07:42 +0000]
Rename cnfvar unittest so it is actually being found and used

5 years agoMake all internal imports relative
Christian Herdtweck [Tue, 22 May 2018 09:58:50 +0000]
Make all internal imports relative

5 years agoRemove test code from zip_stream module, add comments
Christian Herdtweck [Tue, 22 May 2018 09:51:14 +0000]
Remove test code from zip_stream module, add comments

5 years agoIncrease version to 1.2
Christian Herdtweck [Tue, 22 May 2018 09:34:55 +0000]
Increase version to 1.2

5 years agoInstall into subdir pyi2ncommon in site-packages
Christian Herdtweck [Tue, 22 May 2018 09:34:42 +0000]
Install into subdir pyi2ncommon in site-packages

Before, all files src/*.py were just copied to /usr/lib/pythonX.X/site-packages

5 years agoMove template for tests to template dir
Christian Herdtweck [Tue, 22 May 2018 10:09:07 +0000]
Move template for tests to template dir

5 years agoMerge branch 'zip-stream'
Christian Herdtweck [Tue, 22 May 2018 10:34:53 +0000]
Merge branch 'zip-stream'

5 years agoCreate template subdir, move template there
Christian Herdtweck [Tue, 22 May 2018 09:33:44 +0000]
Create template subdir, move template there

Could otherwise not get template.py out of installed code

5 years agoAdd a TODO to track current development directions.
Plamen Dimitrov [Mon, 12 Sep 2016 15:08:13 +0000]
Add a TODO to track current development directions.

5 years agoCreate a streamable version of ZipFile
Christian Herdtweck [Fri, 18 May 2018 13:57:04 +0000]
Create a streamable version of ZipFile

Python's ZipFile requires data in memory or on disc in order to compress it.
This module contains class ZipStream that extends ZipFile to allow read-only,
non-seekable streams as input.

For python < 3.5 this requires python-zipfile35; implementation is MUCH simpler
for python >= 3.6

6 years agoDo not color output to non-terminal; improve print() arg handling
Christian Herdtweck [Fri, 2 Feb 2018 12:58:42 +0000]
Do not color output to non-terminal; improve print() arg handling

6 years agoHandle missing parameters to log string
Christian Herdtweck [Thu, 14 Dec 2017 10:45:37 +0000]
Handle missing parameters to log string

6 years agoMore output from test to simplify debugging; set thresh back to 1s
Christian Herdtweck [Wed, 6 Dec 2017 12:20:51 +0000]
More output from test to simplify debugging; set thresh back to 1s

6 years agoUse a monotonic wall clock for performance tests also in py2
Christian Herdtweck [Wed, 6 Dec 2017 12:16:01 +0000]
Use a monotonic wall clock for performance tests also in py2

This fixes the problem enountered sometimes in unittest test_log_read. The
clock was not precise enough (10ms beat)

6 years agoMake src and test a package by adding __init__.py
Christian Herdtweck [Wed, 6 Dec 2017 12:15:12 +0000]
Make src and test a package by adding __init__.py

6 years agoMake sure unittests only import from src
Christian Herdtweck [Wed, 6 Dec 2017 12:14:51 +0000]
Make sure unittests only import from src

Before, the imports could have been from an earlier installed version of
pyi2ncommon.

6 years agoSkip unittest that fails when building rpm
Christian Herdtweck [Wed, 6 Dec 2017 09:46:32 +0000]
Skip unittest that fails when building rpm

Test succeeds if running unittests on shell, but fails when building rpm.
For some reason there is an extra thread that behaves unexpected.

6 years agoMerge branch 'cnfvar-py'
Christian Herdtweck [Fri, 1 Dec 2017 15:33:05 +0000]
Merge branch 'cnfvar-py'

6 years agoChange version to 1.1
Christian Herdtweck [Fri, 1 Dec 2017 15:27:06 +0000]
Change version to 1.1

6 years agoBe more generous with reading delay in unittest
Christian Herdtweck [Fri, 1 Dec 2017 15:26:55 +0000]
Be more generous with reading delay in unittest

6 years agoMake compatible again with py2
Christian Herdtweck [Fri, 1 Dec 2017 15:26:34 +0000]
Make compatible again with py2

6 years agoBuild dist with py3
Christian Herdtweck [Fri, 1 Dec 2017 15:25:59 +0000]
Build dist with py3

6 years agouse string type for writing to stdout
Philipp Gesang [Fri, 1 Dec 2017 15:14:56 +0000]
use string type for writing to stdout

6 years agoimprove description of cnfvar.py command line usage
Philipp Gesang [Fri, 1 Dec 2017 11:40:05 +0000]
improve description of cnfvar.py command line usage

Try it out:

    $ ssh some-intranator '/usr/intranator/bin/get_cnf' |python3 src/cnfvar.py -

6 years agoadapt cnfvar stdout writer for python3
Philipp Gesang [Fri, 1 Dec 2017 11:33:11 +0000]
adapt cnfvar stdout writer for python3

stdio output still trips over the bytes / string separation. Fix
it by defaulting to bytes which mirrors the reader. Add optional
string writer for use with direct text output.

6 years agotest for toplevel line after popping nested var
Philipp Gesang [Fri, 1 Dec 2017 11:16:34 +0000]
test for toplevel line after popping nested var

After reaching the end of a sequence of CNF siblings at nesting
level > 1, the parser crashes because the updated current line
is a toplevel line:

    234  FIREWALL_NETGROUP,1: "i2n"
    235     (234) FIREWALL_NETGROUP_NETWORK,0: ""
    236        (235) FIREWALL_NETGROUP_NETWORK_IP,0: "172.16.1.0"
    237        (235) FIREWALL_NETGROUP_NETWORK_NETMASK,0: "255.255.255.0"
    238  FIREWALL_NETGROUP,2: "drift-extern" # <----------------------------------- boom!
    239     (238) FIREWALL_NETGROUP_NETWORK,0: "drift"
    240        (239) FIREWALL_NETGROUP_NETWORK_IP,0: "172.16.1.85"
    241        (239) FIREWALL_NETGROUP_NETWORK_NETMASK,0: "255.255.255.255"

Fix by testing for parent lines and exiting immediately.

6 years agofix stdio processing in cnfvar.py
Philipp Gesang [Fri, 1 Dec 2017 10:57:50 +0000]
fix stdio processing in cnfvar.py

Data not supplied from the Python end still suffers from encoding
issues, so fix those.

6 years agoextend cnfvar.py description
Philipp Gesang [Fri, 1 Dec 2017 10:40:29 +0000]
extend cnfvar.py description

Also amend the formatting that got distorted by autopep8 in
Autotest.

6 years agoadd license blurb to cnfvar files
Philipp Gesang [Fri, 1 Dec 2017 10:15:20 +0000]
add license blurb to cnfvar files

All repo files are under GPLv2+ with linking exception.

6 years agoupdate cnfvar unittest for python 3
Philipp Gesang [Fri, 1 Dec 2017 10:12:22 +0000]
update cnfvar unittest for python 3

6 years agoimport cnfvar and unit tests
Philipp Gesang [Fri, 1 Dec 2017 10:08:39 +0000]
import cnfvar and unit tests

cnfvar.py          <- intranator/backup-crypto
cnfvar_unittest.py <- autotest-intranator/backup-crypto

Consequently, cnfvar.py has already been adapted for Python 3,
the unit tests have not.

7 years agoRename shortened to head_and_tail
Christian Herdtweck [Wed, 7 Dec 2016 15:10:10 +0000]
Rename shortened to head_and_tail

7 years agoCreate unittest for shortened(...)
Christian Herdtweck [Wed, 7 Dec 2016 10:21:56 +0000]
Create unittest for shortened(...)

7 years agoCreate text_helper shortened(...)
Christian Herdtweck [Wed, 7 Dec 2016 10:21:47 +0000]
Create text_helper shortened(...)

7 years agoFix unittests for color output functions
Christian Herdtweck [Wed, 7 Dec 2016 10:21:32 +0000]
Fix unittests for color output functions

7 years agoMake text_helpers py2-compatible
Christian Herdtweck [Wed, 7 Dec 2016 10:21:08 +0000]
Make text_helpers py2-compatible

7 years agoMore error handling in log_read
Christian Herdtweck [Wed, 7 Dec 2016 10:20:39 +0000]
More error handling in log_read

7 years agoAdd unittest for new text_helpers.
Christian Herdtweck [Fri, 7 Oct 2016 14:22:59 +0000]
Add unittest for new text_helpers.

Can only test whether functions raise an error since correct behaviour is
hard to test automatically.

7 years agoCreate text_helpers with color/style functions for output
Christian Herdtweck [Fri, 7 Oct 2016 14:21:34 +0000]
Create text_helpers with color/style functions for output

7 years agoUpdate unittest template and skip one test
Christian Herdtweck [Fri, 7 Oct 2016 14:21:00 +0000]
Update unittest template and skip one test

7 years agoIgnore automatically created api doc files
Christian Herdtweck [Fri, 7 Oct 2016 14:19:30 +0000]
Ignore automatically created api doc files

7 years agoremove warning that is triggered quite often and purely informal
Christian Herdtweck [Wed, 29 Jun 2016 15:08:14 +0000]
remove warning that is triggered quite often and purely informal

7 years agoremove whitespace
Christian Herdtweck [Wed, 29 Jun 2016 15:07:10 +0000]
remove whitespace

7 years agocreated simple LogParser
Christian Herdtweck [Wed, 29 Jun 2016 15:06:59 +0000]
created simple LogParser

7 years agofix typo in docu and extend a little
Christian Herdtweck [Wed, 29 Jun 2016 15:05:55 +0000]
fix typo in docu and extend a little

7 years agoimprove docu
Christian Herdtweck [Wed, 29 Jun 2016 15:04:59 +0000]
improve docu

7 years agoensure NOTICE log level is always int
Christian Herdtweck [Wed, 29 Jun 2016 15:04:29 +0000]
ensure NOTICE log level is always int