rhevm-qe-automation / python-rrmngmnt Goto Github PK
View Code? Open in Web Editor NEWThis project forked from machacekondra/python-rrmngmnt
REmote REsources MaNaGeMeNT
License: GNU General Public License v2.0
This project forked from machacekondra/python-rrmngmnt
REmote REsources MaNaGeMeNT
License: GNU General Public License v2.0
is_connective - is not descriptive, it tests ssh connectivity, maybe I am interested in network connectivity in general (answer to ping) ...
I would like to see:
in additional there could be function in network module is_port_open(port, proto='tcp'), but maybe later when it is needed.
enable tests as well
get_ssh_public_key, remove_remote_* methods move to ssh module, bind it to executor
We should see how is the lib covered by tests
it should be fs.touch(path), or fs.touch(*paths), but not fs.touch(dir, file)
it also should raise relevant exception
Name Stmts Miss Cover
-------------------------------------------------
rrmngmnt/package_manager.py 101 56 45%
there should be MountPoint class which holds all related parameters.
implements methods:
it can be used in storage.py for nfs service.
SInce introduction of upload_playbook
parameter to PlaybookRunner.run()
method, we allow the users to upload the target playbook on their own to a remote resources. However, vars_files
and vault_password_file
parameters still require local paths and still upload local files to a remote host. We need to change PlaybookRunner.run()
interface so that either
This should be driven by the value passed to upload_playbook
parameter. For more context, see my conversation with Lukas here: https://github.com/rhevm-qe-automation/python-rrmngmnt/pull/129/files#r422892028
there are several checks which validate host address whether it is ip4, so it is impossible to create Host with ip6 address
when using UserWithPKey function with private key that generated from 'ssh-keygen -t ed25519 -N ''
-f /<file_name>'. algorithm it doesn't work and failed on : Traceback (most recent call last):
File "/home/mgold/Downloads/pycharm-community-2020.1.2/plugins/python-ce/helpers/pydev/_pydevd_bundle/pydevd_exec2.py", line 3, in Exec
exec(exp, global_vars, local_vars)
File "", line 1, in
File "/home/mgold/rhevm-art/.art/lib/python3.6/site-packages/rrmngmnt/host.py", line 326, in service
service = self._create_service(name, timeout)
File "/home/mgold/rhevm-art/.art/lib/python3.6/site-packages/rrmngmnt/host.py", line 293, in _create_service
service = provider(self, name, timeout=timeout)
File "/home/mgold/rhevm-art/.art/lib/python3.6/site-packages/rrmngmnt/service.py", line 49, in init
self._can_handle()
File "/home/mgold/rhevm-art/.art/lib/python3.6/site-packages/rrmngmnt/service.py", line 173, in _can_handle
super(Systemd, self)._can_handle()
File "/home/mgold/rhevm-art/.art/lib/python3.6/site-packages/rrmngmnt/service.py", line 92, in _can_handle
io_timeout=self.timeout,
File "/home/mgold/rhevm-art/.art/lib/python3.6/site-packages/rrmngmnt/ssh.py", line 259, in run_cmd
with self.session(tcp_timeout) as session:
File "/home/mgold/rhevm-art/.art/lib/python3.6/site-packages/rrmngmnt/ssh.py", line 246, in session
return RemoteExecutor.Session(self, timeout)
File "/home/mgold/rhevm-art/.art/lib/python3.6/site-packages/rrmngmnt/ssh.py", line 66, in init
self._executor.user.private_key
File "/home/mgold/rhevm-art/.art/lib/python3.6/site-packages/paramiko/pkey.py", line 235, in from_private_key_file
key = cls(filename=filename, password=password)
File "/home/mgold/rhevm-art/.art/lib/python3.6/site-packages/paramiko/rsakey.py", line 55, in init
self._from_private_key_file(filename, password)
File "/home/mgold/rhevm-art/.art/lib/python3.6/site-packages/paramiko/rsakey.py", line 176, in _from_private_key_file
self._decode_key(data)
File "/home/mgold/rhevm-art/.art/lib/python3.6/site-packages/paramiko/rsakey.py", line 192, in _decode_key
n, e, d, iqmp, q, p = self._uint32_cstruct_unpack(data, "iiiiii")
File "/home/mgold/rhevm-art/.art/lib/python3.6/site-packages/paramiko/pkey.py", line 529, in _uint32_cstruct_unpack
raise SSHException(str(e))
paramiko.ssh_exception.SSHException: unpack requires a buffer of 4 bytes
need to initialize proper key class. there is class per each format in paramiko
Travis-CI can do it for us, follow https://docs.travis-ci.com/user/deployment/pypi/
We have many deprecated warnings in this code base. And we should remove them in 0.2.0 version
Command which I am using looks like this:
remove_old_repo_cmd = [
'rpm', '-qa', ''(abc|drf)*'', '|', 'xargs', 'rpm',
'-e'
]
It would be great have this functionality in package_manager.
NOTE it should be encapsulated for all package managers which are covered by this module.
Running my script with python3 fails. Python 2 is alright.
return self.host.os.release_info
File "/usr/local/lib/python3.6/site-packages/rrmngmnt/operatingsystem.py", line 82, in release_info
self._release_info = self.get_release_info()
File "/usr/local/lib/python3.6/site-packages/rrmngmnt/operatingsystem.py", line 73, in get_release_info
values = line.split("=", 1)
TypeError: a bytes-like object is required, not 'str'
$ python3 --version
Python 3.6.4
$ pip3 list | grep rrmn
python-rrmngmnt (0.1.14)
you don't have control what user is used to execute command on remote host.
create_script, maybe abandon it or move to filesystem ...
E assert b'echo hello' == 'echo hello'
E + where b'echo hello' = <tests.common.ByteFakeFile object at 0x7ff64d081be8>.data
python-rrmngmnt/rrmngmnt/host.py
Line 233 in 14ae0c9
it should be:
ef = copy.copy(self.executor_factory)
and here
python-rrmngmnt/rrmngmnt/host.py
Line 235 in 14ae0c9
there should be
return ef(self.ip, user, self.sudo)
today, there is NFSService class, providing mount/umount methods which seems to me be unrelated.
mount / umount is the responsibility of filesystem, and it is not related to nfs service.
I would expect methods like:
And add several lines to README
It is responsibility of executor, no need for this method.
should raise CommandExecutionFailure instead of Exception
move that method under filesystem module. and do some alignment.
it must be obvious whether I copy file:
get_os_info - create new module for operating system related stuff
Now if I create two Host resources in different threads with the same IP I can fall in the situation:
There should be way how to control power_management of Host.
At least for ssh, and ipmitool, and also add option to define own PM, for example for oVirt vms or something like that.
Using host.service on a RHEL Atomic host doesn't find suitable service provider even though systemd provider should be a match for this.
Service: ovirt-guest-agent
Today we have an option to use ssh key to auth, but it assumes keys to be stored in ~/.ssh directory.
In general we can have bunch of ssh keys, to auth with different hosts across our network ...
So this behavior limits us in that way.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.