Compare commits
2 Commits
e3287424fc
...
0a46ed0c87
Author | SHA1 | Date | |
---|---|---|---|
0a46ed0c87 | |||
5a8b71bfbe |
13
LICENSE
Normal file
13
LICENSE
Normal file
@ -0,0 +1,13 @@
|
||||
Copyright 2023 Markus Pesch
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
10
main.py
10
main.py
@ -64,6 +64,10 @@ def main():
|
||||
yaml.dump(local_config, f)
|
||||
|
||||
def create_ssh_client(hostname: str, port: str, username: str, identity_file: str, identity_passphrase: str) -> SSHClient:
|
||||
'''
|
||||
create_ssh_client returns based on passed arguments an SSHClient for example
|
||||
to establish a connection.
|
||||
'''
|
||||
ssh_client = paramiko.SSHClient()
|
||||
ssh_client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
||||
|
||||
@ -77,8 +81,12 @@ def create_ssh_client(hostname: str, port: str, username: str, identity_file: st
|
||||
|
||||
return ssh_client
|
||||
|
||||
|
||||
def from_private_key(file_obj, password=None) -> PKey:
|
||||
'''
|
||||
from_private_key returns a private key object based on a passed file and an
|
||||
optional password
|
||||
'''
|
||||
|
||||
private_key = None
|
||||
file_bytes = bytes(file_obj.read(), "utf-8")
|
||||
try:
|
||||
|
@ -2,3 +2,4 @@ cryptography==39.0.1
|
||||
paramiko==2.11.1
|
||||
PyYAML==6.0
|
||||
scp==0.14.4
|
||||
setuptools==67.3.0
|
||||
|
37
setup.py
Normal file
37
setup.py
Normal file
@ -0,0 +1,37 @@
|
||||
import os
|
||||
from setuptools import setup
|
||||
|
||||
try:
|
||||
readme = open(os.path.join(os.path.dirname(__file__), "README.md")).read()
|
||||
except ValueError:
|
||||
readme = ""
|
||||
|
||||
setup(
|
||||
name="kcf",
|
||||
description="A script to merge a remote kubectl configuration with a local one",
|
||||
long_description=readme,
|
||||
long_description_content_type="text/markdown",
|
||||
# Documentation: https://gist.github.com/nazrulworld/3800c84e28dc464b2b30cec8bc1287fc
|
||||
classifiers=[
|
||||
"Programming Language :: Python",
|
||||
"Programming Language :: Python :: 3",
|
||||
"Programming Language :: Python :: 3.10",
|
||||
"Development Status :: 3 - Alpha",
|
||||
"Topic :: Software Development",
|
||||
"License :: OSI Approved :: MIT License"
|
||||
],
|
||||
keywords="kubernetes, kubectl",
|
||||
author="Markus Pesch",
|
||||
author_email="markus.pesch@cryptic.systems",
|
||||
url="https://github.com/volker-raschek/kcf",
|
||||
# py_modules=[""],
|
||||
# include_package_data=True,
|
||||
license="Apache 2.0",
|
||||
install_requires=[
|
||||
"cryptography>=39.0.1",
|
||||
"paramiko>=2.11.1",
|
||||
"PyYAML>=6.0",
|
||||
"scp>=0.14.4",
|
||||
"setuptools>=67.3.0"
|
||||
],
|
||||
)
|
Loading…
x
Reference in New Issue
Block a user