Skip to content

Commit

Permalink
Add changelog / spring cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
hkraal committed Feb 8, 2019
1 parent aeeb236 commit 0214dc9
Show file tree
Hide file tree
Showing 10 changed files with 52 additions and 22 deletions.
1 change: 1 addition & 0 deletions .pyup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
# see https://pyup.io/docs/configuration/ for all available options

update: insecure
schedule: "every week"
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
language: python
python:
- "2.6"
- "2.7"
- "3.3"
- "3.4"
- "3.5"
- "3.6"
Expand Down
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Added
- Changelog (Hello there!).
- Allow wildcards in search string.
- Search multiple object properties.
- Support for JSON API endpoint.

### Fixed
- Invalid JSON trows exception.

### Removed
- Removed support for Python 2.6
- Removed support for Python 3.3


[Unreleased]: https://github.com/hkraal/ssht/compare/v0.7.2a0...master
What is a changelog?
A changelog is a file which contains a curated, chronologically ordered list of notable changes for each version of a project.

Why keep a changelog?
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ SSH client wrapper for easily connecting to hosts
[![Build Status](https://travis-ci.org/hkraal/ssht.svg?branch=master)](https://travis-ci.org/hkraal/ssht)
[![Coverage Status](https://coveralls.io/repos/github/hkraal/ssht/badge.svg?branch=master)](https://coveralls.io/github/hkraal/ssht?branch=master)
[![Requirements Status](https://requires.io/github/hkraal/ssht/requirements.svg?branch=master)](https://requires.io/github/hkraal/ssht/requirements/?branch=master)

![](https://img.shields.io/pypi/pyversions/ssht.svg?style=flat)

This wrapper for the well known `ssh` client makes it possible to connect to the right server with just typing a part of the host name. The external sources are queried using the search term and those matching the string will be presented as an option.

Expand Down
3 changes: 3 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
[aliases]
test=pytest

[pycodestyle]
exclude = .eggs/
8 changes: 4 additions & 4 deletions ssht/plugins.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import os
import logging
import fnmatch
import json
import requests
import logging
import os

import mysql.connector
import fnmatch
import requests


class Host(object):
Expand Down
8 changes: 4 additions & 4 deletions ssht/ssht.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
@author: Henk Kraal
'''
import argparse
import subprocess
import shlex
import logging

from .plugins import JsonParser, MySQLParser, APIParser
import os
import shlex
import subprocess
import sys

from .plugins import JsonParser, MySQLParser, APIParser


def ssh_connect(host, args):
logging.debug('args = {0}'.format(args))
Expand Down
12 changes: 8 additions & 4 deletions tests/test_host.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
@author: henk
'''
from ssht.plugins import Host
import pytest

from ssht.plugins import Host


class TestHost:

Expand All @@ -31,6 +32,9 @@ def test_factory_exception(self):
Host.factory('host01.example.com')

def test_host_repr(self):
assert repr(Host(
hostname='host01.example.com')) == '<Host: hostname=host01.example.com>'
ipv4='192.168.0.2')) == '<Host: hostname=host01.example.com, ipv4=192.168.0.2>'
assert repr(
Host(hostname='host01.example.com')
) == '<Host: hostname=host01.example.com>'
assert repr(
Host(hostname='host01.example.com', ipv4='192.168.0.2')
) == '<Host: hostname=host01.example.com, ipv4=192.168.0.2>'
4 changes: 2 additions & 2 deletions tests/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
@author: henk
'''
from ssht.plugins import Parser, Host, JsonParser
import pytest


class TestParser:
Expand Down Expand Up @@ -72,7 +71,8 @@ def _get_file_content(file_):

def test_load_valid_data(mocker):
def _get_file_content(file_):
return '{ "hosts": [{ "port": "2222", "hostname": "host01.example.com", "ipv4": "192.168.0.2", "user": "root"}] }'
return '{ "hosts": [{ "port": "2222", "hostname": "host01.example.com", \
"ipv4": "192.168.0.2", "user": "root"}] }'

jsonparser = JsonParser('/tmp')
jsonparser._files = ['test.json']
Expand Down
8 changes: 3 additions & 5 deletions tests/test_ssht.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@
@author: henk
'''
import logging
import os
import subprocess

from ssht.ssht import ssh_connect, select_host, get_log_level
from ssht.plugins import Host
import ssht
import logging
import os
from os import unsetenv
from ssht.ssht import ssh_connect, select_host, get_log_level


class TestConnect:
Expand Down

0 comments on commit 0214dc9

Please sign in to comment.