Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

Commit

Permalink
Merge pull request #39 from quipucords/rho-2.0
Browse files Browse the repository at this point in the history
Merge `rho-2.0` into `master`
  • Loading branch information
chambridge committed Jun 29, 2017
2 parents e95fe0c + 7f951c7 commit 7580dcc
Show file tree
Hide file tree
Showing 56 changed files with 3,773 additions and 6,585 deletions.
4 changes: 4 additions & 0 deletions .coveragerc
@@ -0,0 +1,4 @@
[report]
omit =
*/python?.?/*
*/python?.?-dev/*
6 changes: 6 additions & 0 deletions .gitignore
Expand Up @@ -4,6 +4,7 @@
*$py.class
*.swp
*.patch
.idea
*#
*~
*.egg
Expand All @@ -15,3 +16,8 @@ dist
build
.build
test/coverage
data
roles

.vagrant
*.retry
17 changes: 17 additions & 0 deletions .travis.yml
@@ -0,0 +1,17 @@
language: python
python:
- "2.7"
- "3.5"
- "3.6"
# command to install dependencies
install:
- pip install -r requirements.txt
- pip install coveralls
# command to run tests
script:
- make all
after_success:
coveralls
notifications:
slack:
secure: SSlalMN72w3gghu0RRTEznrdVgFCSCLheutRp9O9W82LVaz4K7xu9Qel7pRghgoiafS2nBufaGXrmk6mj4InNhJfc0hwLpa9kZcntD8kuap5qJC4A5Qvx1gq+70DjVbaVbBfrAl1Bsu+dkR6SfuCV9sWTFjUfnCt5H1ugprQXe0utLt7P//ZELOWVghyiFBIr+kOrUCfDV0HecTHOxQIFlxZpB2Y0QGYXUwtljhVFaMcCQLHvOhQelIellrRjSUURQOo9TLw8NQUdJHWxnKqAXl2VNG9CCRKJoH6i1sGi53gWou+EeKXM6ERCgO4mgzDyrPJe644Q7e6Gt6Htz1Oc22n0ghR4CE62B44bzhtViCmpptmgMIFLJfEg+zq0ZQzdxSx6dblkT0hC/dVwPLyjUFffojYPnarx9rvmM56yq3FS++2nbSg2JLvscHCDYqbivykdgz80VujxfYKSOtHTirteNDbKinx1DtibBhl0GNeRE0xM/OEPgLyD1eQbak7Dfr9rwebO2sSxplvH5CNn16jarpnqC+2x47leNOxjba2Je/fN01tIcHKQzgVn7TI/jfek+CJpqdgU2eXpz0g18PnPjMpdfZefdW2V/HTA7ucCJyoDEuouI54AtzvW3Oi9kJ81kesutNBl1zyCjiGrL9ynyDS9xPmPbJCWTTXw9A=
5 changes: 0 additions & 5 deletions AUTHORS

This file was deleted.

9 changes: 9 additions & 0 deletions AUTHORS.rst
@@ -0,0 +1,9 @@
rho was written by Adrian Likins <alikins@redhat.com>, Devan Goodwin
<dgoodwin@redhat.com>, Jesus M. Rodriguez <jesusr@redhat.com>, and Chris
Snyder <csnyder@redhat.com>.

rho 2.0 was written by Karthik Harihar Reddy Battula <karthikhhr@gmail.com>,
Chris Hambridge <chambrid@redhat.com>, and Noah Lavine <nlavine@redhat.com>.

rho is maintained by Chris Hambridge <chambrid@redhat.com>
and Noah Lavine <nlavine@redhat.com>
16 changes: 16 additions & 0 deletions CHANGES.rst
@@ -0,0 +1,16 @@
----------------
Changes
----------------
version 2.0
* Made rho rely on Ansible for all of it's scanning needs.

version 0.2
* Added ability to detect and correctly categorize virtual hosts and guests.

version 0.1 (Initial release)
* Runs scans for RHEL systems, upstream (Fedora) systems, downstream (CentOS) systems, and other flavors of Linux and Unix.
* Introduces auth and profile configuration for setting up rho.
* Scans user-defined IP address ranges and hostnames for an entire network or subnet.
* Allows existing JSON configuration files to be loaded for configuration.
* Outputs results to CSV file reports.
* Allows the report format to be customized.
95 changes: 95 additions & 0 deletions CONTRIBUTING.rst
@@ -0,0 +1,95 @@
######################
Contributing to rho
######################

Bug reports and code and documentation patches are welcome. You can
help this project also by using the development version of rho
and by reporting any bugs you might encounter.

1. Reporting bugs
=================

It's important that you provide the full command argument list
as well as the output of the failing command.

.. code-block:: bash
$ rho [COMPLETE ARGUMENT LIST THAT TRIGGERS THE ERROR]
[COMPLETE OUTPUT]
Additionally, attach any relevant input files after scrubbing any private
information.


2. Contributing Code and Docs
=============================

Before working on a new feature or a bug, please browse `existing issues`_
to see whether it has been previously discussed. If the change in question
is a bigger one, it's always good to discuss before you starting working on
it.


Creating Development Environment
--------------------------------

Go to https://github.com/quipucords/rho and fork the project repository. Each
branch should correspond to an associated issue opened on the main repository
(e.g. ``issues/5`` --> https://github.com/quipucords/rho/issues/5).


.. code-block:: bash
git clone https://github.com/<YOU>/rho
cd rho
git checkout -b issues/my_issue_#
pip install -r requirements.txt
make all
Making Changes
--------------

Please make sure your changes conform to `Style Guide for Python Code`_ (PEP8).
You can run the lint command on your branch to check compliance.

.. code-block:: bash
make lint
Testing
-------

Before opening a pull requests, please make sure the `tests`_ pass
in all of the supported Python environments (2.7, 3.5, 3.6).
You should also add tests for any new features and bug fixes.

rho uses `pytest`_ for testing.


Running all tests:
******************

.. code-block:: bash
# Run all tests on the current Python interpreter
make tests
# Run all tests on the current Python with coverage
make tests-coverage
-----

See `Makefile`_ for additional development utilities.

.. _existing issues: https://github.com/quipucords/rho/issues?state=open
.. _AUTHORS: https://github.com/quipucords/rho/blob/master/AUTHORS.rst
.. _Makefile: https://github.com/quipucords/rho/blob/master/Makefile
.. _pytest: http://pytest.org/
.. _Style Guide for Python Code: http://python.org/dev/peps/pep-0008/
.. _tests: https://github.com/quipucords/rho/tree/master/tests
20 changes: 0 additions & 20 deletions HACKING

This file was deleted.

78 changes: 22 additions & 56 deletions Makefile
@@ -1,80 +1,46 @@
DATE = $(shell date)
PYTHON = /usr/bin/python

MESSAGESPOT=po/rho.pot
PYTHON = $(shell which python)

TOPDIR = $(shell pwd)
DIRS = test bin locale src
PYDIRS = src/rho
PYFILES = $(wildcard src/rho/*.py)
PYDIRS = rho

BINDIR = bin

#MANPAGES = funcd func func-inventory func-transmit func-build-map func-create-module

all: build
help:
@echo "Please use \`make <target>' where <target> is one of:"
@echo " help to show this message"
@echo " all to to execute all following targets (except test)"
@echo " lint to run all linters"
@echo " lint-flake8 to run the flake8 linter"
@echo " lint-pylint to run the pylint linter"
@echo " test to run unit tests"
@echo " test-coverage to run unit tests and measure test coverage"

versionfile:
echo "version:" $(VERSION) > etc/version
echo "release:" $(RELEASE) >> etc/version
echo "source build date:" $(DATE) >> etc/version
echo "git commit:" $(shell git log -n 1 --pretty="format:%H") >> etc/version
echo "git date:" $(shell git log -n 1 --pretty="format:%cd") >> etc/version
all: build lint tests-coverage

# echo $(shell git log -n 1 --pretty="format:git commit: %H from \(%cd\)") >> etc/version
#manpage:
# for manpage in $(MANPAGES); do (pod2man --center=$$manpage --release="" ./docs/$$manpage.pod | gzip -c > ./docs/$$manpage.1.gz); done

build: clean versionfile
build: clean
$(PYTHON) setup.py build -f

clean:
-rm -f MANIFEST etc/version .figleaf_interesting
-rm -f MANIFEST etc/version
-rm -rf dist/ build/ test/coverage rpm-build/ rho.egg-info/
-rm -rf *~
-rm -rf .figleaf
-rm -rf docs/*.gz
# -for d in $(DIRS); do ($(MAKE) -C $$d clean ); done

confclean:
-rm -rf ~/.rho.conf

# this is slightly nuts,we keep "versioned" copies of the conf file, just in case
confbackup:
-cp ~/.rho.conf ./.rho.conf-backup/rho.conf-backup-`date +"%s"`

# pop the latest stored
confrestore:
-mv ./.rho.conf-backup/`ls -t ./.rho.conf-backup/ | head -1` ~/.rho.conf


install: build
$(PYTHON) setup.py install -f


tests:
-nosetests -d -v -a '!slow'
-py.test -v

coverage:
# figleaf needs full paths...
# needs figleaf installed, see http://darcs.idyll.org/~t/projects/figleaf/doc/
-rm -f .figleaf_interesting
-for file in $(PYFILES); do echo $(TOPDIR)/$$file >> .figleaf_interesting; done
-figleaf -i /usr/bin/nosetests -d -v -a '!slow'
-figleaf2html -d test/coverage -f .figleaf_interesting .figleaf
tests-coverage:
-py.test -v --cov=rho

sdist: messages
$(PYTHON) setup.py sdist
lint-flake8:
flake8 . --ignore D203

pychecker:
-for d in $(PYDIRS); do PYTHONPATH=$(TOPDIR)/src pychecker --limit 100 --only $$d/*.py; done
-PYTHONPATH=$(TOPDIR)/src pychecker bin/rho
pyflakes:
-for d in $(PYDIRS); do PYTHONPATH=$(TOPDIR)/src pyflakes $$d/*.py; done
-PYTHONPATH=$(TOPDIR)/src pyflakes bin/rho
pylint:
-for d in $(PYDIRS); do PYTHONPATH=$(TOPDIR)/src pylint $$d/*.py; done
-PYTHONPATH=$(TOPDIR)/src pylint bin/rho
money: clean
-sloccount --addlang "makefile" $(TOPDIR) $(PYDIRS)
lint-pylint:
pylint */*.py

lint: lint-flake8 lint-pylint

0 comments on commit 7580dcc

Please sign in to comment.