Commit Graph
100 Commits
Author SHA1 Message Date
Matthew Jones 41d5393af0 Clean up flake8 related issues 2016-02-23 15:30:07 -05:00
Matthew Jones 4b1493f456 Fixing up some unicode issues 2016-02-23 15:26:29 -05:00
Matthew Jones 75ef0dd395 Implement tower ui view url on models 2016-02-23 14:19:42 -05:00
Matthew Jones b88892be49 Sanity check and force proper types in admin check 2016-02-23 12:33:30 -05:00
Matthew Jones 050ed8a200 Proper type for in check
Still an __in for when we need to add another trigger obj
2016-02-23 12:18:31 -05:00
Matthew Jones 39c942e98b Adding migration and base notification type 2016-02-23 11:20:08 -05:00
Matthew Jones 4928badd3f Add a periodic administrative notification 2016-02-23 10:59:08 -05:00
Matthew Jones ab3669efa9 Refactor message generator
* Job object can now control the output and generate K:V output for
  notification types that can support it
* Notifications store the body as json/dict now to encode more
  information
* Notification Type can further compose the message based on what is
  sensible for the notification type
* This will also allow customizing the message template in the future
* All notification types use sane defaults for the level of detail now
2016-02-22 17:09:36 -05:00
Matthew Jones eb3d663d18 Support notification password field encryption
Modify encrypt_field and decrypt_field to support sub-fields under a
dictionary object.  It still uses the parent key when encrypting.
2016-02-21 23:11:17 -05:00
Matthew Jones 52974648df Notification configuration type checking 2016-02-17 16:01:54 +00:00
Matthew Jones dde70dafec Refactor NotificationTemplate to Notifier 2016-02-17 15:18:18 +00:00
Matthew Jones 9d6739045a Implement irc notification backend 2016-02-11 15:34:27 -05:00
Matthew Jones 7abcb6e306 Add webhook notification backend 2016-02-10 17:03:57 -05:00
Matthew Jones 34ebe0a848 Pagerduty and Hipchat backends plus some cleanup 2016-02-10 15:17:11 -05:00
Matthew Jones 8db2f60405 Notification serializers, views, and tasks
* Implement concrete Notification model for notification runs
* Implement NotificationTemplate and Notification serializers and views
* Implement ancillary views
* Implement NotificationTemplate trigger m2m fields on all job templates
  via a fields mixin
* Link NotificationTemplates with an org
* Link notifications with the activity stream
* Implement Notification celery tasks
* Extend Backend field parameters to identify sender and receiver as
  parameters needed by the message and not the backend itself
* Updates to backends to better fit the django email backend model as it
  relates to Messages
* Implement success job chain task + notifications
* Implement notifications in error job chain task
2016-02-09 23:12:55 -05:00
Matthew Jones 319deffc18 Implement notification serializer and validations 2016-02-04 15:52:23 -05:00
Matthew Jones 172207cd4b Notification endpoints and url expositions
Also some changes to the footprint of the notification handler classes
2016-02-04 15:52:23 -05:00
Matthew Jones 96b0fb168f Updating makefile migration generator 2016-02-04 15:52:23 -05:00
Matthew Jones 805514990b Changes to celery tasks to support success signals
Linking in a success callback that will be invoked by our UnifiedJobs in
the case they terminate normally.  This is where we'll hook in the
success notification type.
2016-02-04 15:52:23 -05:00
Matthew Jones 7385efef35 Adding some early Notifications stubs
* A basic NotificationTemplate model class with early notification type
  definitions
* Initial implementations of the Email, Slack, and Twilio Notification
  backends using the Django email backend system
* Some dependencies thereof
2016-02-04 15:52:23 -05:00
Matthew Jones 7ab839c17f Fix up another statsd formatting error 2016-02-02 14:26:17 -05:00
Matthew Jones 5d21ad5ae6 Fix up statsd work to support python 2.6
Format specifiers must include field specifier
2016-02-02 09:58:19 -05:00
Matthew Jones f9f10a4ed7 Add some more statsd dummy methods 2016-01-30 12:05:10 -05:00
Matthew Jones 96b754c5ec Switch to StatsClient from StatsClientBase
So as not to use a purely abstract class
2016-01-29 16:27:32 -05:00
Matthew Jones c2875c65ca Fix stats client import 2016-01-29 15:49:51 -05:00
Matthew Jones fd2339dbb8 Fix up flake8 line seperation issue 2016-01-29 14:52:02 -05:00
Matthew Jones c7fd21ae52 Fix up flake8 and unit test failures
* Make sure we default to localhost to not fail at the GAI check
* Cleanup some flake8 issues in the metrics module
2016-01-29 13:59:37 -05:00
Matthew Jones 56d0cbfeff Cover DELETEing the license from database config
Fix the standard license delete behavior on the /config endpoint.  It
was covered elsewhere but this is the common path for license posting/removing
2016-01-26 16:31:38 -05:00
Matthew Jones 769fe18724 Wrap up other places where the old license access method is used 2016-01-25 20:59:18 -05:00
Matthew Jones f775fa9680 tasks env vars should be strings
This was causing rax unit test failures which are now alleviated
2016-01-25 16:51:33 -05:00
Matthew Jones b35f84b401 Bypass license database check for cleanup schedule
We pre-create some cleanup jobs if a license is already present, this
doesn't work with the database config as-is.  These can be removed at
some point in the future once the 2.4 migration path is not needed
2016-01-25 15:53:17 -05:00
Matthew Jones 3132d4efee Fix license enablement utility helpers
We know call "from_database" which can implicitly call "from_file" if
the database config isn't available.
2016-01-25 14:09:04 -05:00
Matthew Jones dd95b9ed3d Fix up an issue update/assigning config keys
If they already existed or in the case of posting a license it would
fail before.  This fixes that up
2016-01-21 14:44:05 -05:00
Matthew Jones 5a434d86f1 Fix for rax cache timeout issue
2.4.0 level of rax.py introduces a default cache timeout of 600s, this
fixes that and includes a new rax.py inventory module that has been
submitted upstream.
2016-01-20 15:12:52 -05:00
Matthew Jones de55a9e0ed Remove dict comprehension for settings list
Not supported in python 2.6
2016-01-18 16:08:21 -05:00
Matthew Jones 31d9438fdf Rev PBR to 0.11.1 to fix up some dependencies
All openstack modules claim they'll work with this version
2016-01-15 16:22:24 -05:00
Matthew Jones 7801fab953 Fixes rhel 7.2 websocket issue
Rev gevent and greenlet, on another side a fix has been applied to
gevent-socketio.
2016-01-15 13:40:53 -05:00
Matthew Jones 7b12954127 Replace namedtuple with an intermediate class
Named Tuples aren't supported on python 2.5
2016-01-14 15:38:00 -05:00
Matthew Jones 573403a05c Fix v2 playbook_on_start method signature 2016-01-14 11:59:27 -05:00
Matthew Jones b1cbdd3a09 Remove tower settings filter 2016-01-12 15:26:23 -05:00
Matthew Jones eab8743e15 Purge Tower Settings reference from activitystream 2016-01-12 13:52:29 -05:00
Matthew Jones d110943b33 Momentarily peg ansible version at 1.9.4
Having issues with unicode under ansible 2.0
2016-01-12 13:10:37 -05:00
Matthew Jones c442f4923b Fix old python support in scan_services
Python 2.4/RHEL5 doesn't support in-line conditionals so this breaks it
out into a normal multi-line condition
2016-01-12 11:26:55 -05:00
Matthew Jones 272e5829f2 Setup instance during settings unit tests 2016-01-12 09:25:09 -05:00
Matthew Jones 393c4c558c pyflakes fix 2016-01-11 16:42:12 -05:00
Matthew Jones 5c2f555b1d Updating new_in for 3.0 2016-01-11 16:41:55 -05:00
Matthew Jones f366b34847 Adding database config unit tests 2016-01-11 16:01:16 -05:00
Matthew Jones 71c7dc16e3 Removing stray debug statement 2016-01-05 14:59:04 -05:00
Matthew Jones ae12be9afa Fixing up settings reset issue
This is done by not assigning the ActivityStream foreign key.  Which is
almost superflous at this point
2016-01-05 14:34:40 -05:00
Matthew Jones 17bc35053d Merge branch 'release_2.4.3' into devel
* release_2.4.3:
  Avoid packaging crankiness
  Update changelogs
  Update version for 2.4.3 release
  The default value for the allow_callbacks checkbox needs to be a boolean (true/false) and not a string ("true"/"false").  The string will always evaluate to false in the UI and be unchecked.
  Add sample config for LDAP connection options, disable referrals by default, prefetch user groups to reduce LDAP queries when checking group memberships.
2015-12-18 15:55:10 -05:00
Matthew Jones d2f99ad549 Handle operationalerror for unit tests 2015-12-17 14:00:17 -05:00
Matthew Jones 74c06cfc92 Fix up migration path
These settings aren't available during the initial database migration so
we'll use the defaults when bootstrapping the database
2015-12-17 13:13:12 -05:00
Matthew Jones b59e4d8111 Fix up some flake8 import issues 2015-12-17 11:34:01 -05:00
Matthew Jones 4ae8d35cc3 Extra docs for callback plugins manifest entry 2015-12-17 11:26:42 -05:00
Matthew Jones 0e98491dac Remove PROJECTS_ROOT and JOBOUTPUT_ROOT from stngs 2015-12-17 11:22:45 -05:00
Matthew Jones 5e1c98341b Removing a stray debug statement 2015-12-17 10:50:07 -05:00
Matthew Jones 910f9bd4a3 Fixing up some flake8 issues 2015-12-17 10:48:15 -05:00
Matthew Jones df68f839af Update version for 2.4.3 release 2015-12-16 11:34:04 -05:00
Matthew Jones 9db80bd9fc Support tower license within the database
With backwards support for the file-based license
2015-12-16 11:21:52 -05:00
Matthew Jones 35b19bf220 Update settings references
* PROOT
* Pendo tracking state
* ad hoc commands
* activity stream
* org admin visibility
2015-12-15 16:44:08 -05:00
Matthew Jones a4d4e6d0fb Comment out some settings tougher to implement
Specifically ldap and radius
2015-12-15 16:42:54 -05:00
Matthew Jones 0404f6ebc3 Add a note about caching 2015-12-15 16:42:32 -05:00
Matthew Jones dfd1ca4ae9 Relocate AUTH_TOKEN_* settings reference 2015-12-15 15:37:26 -05:00
Matthew Jones e97e60bd30 Update settings location for certain values
* PROJECTS_ROOT
* JOBOUTPUT_ROOT
* SCHEDULE_MAX_JOBS
* STDOUT_MAX_BYTES_DISPLAY
2015-12-15 15:14:16 -05:00
Matthew Jones 16aa34522c Fix up an export issue for tower_settings 2015-12-15 15:13:58 -05:00
Matthew Jones 7867a58c00 RBAC and settings reset
* Initial super-user only rbac with notes for future user-settings
  support
* Clearing individual and all settings back to defaults
2015-12-15 12:12:54 -05:00
Matthew Jones 273181e894 Expand dbconfig support
* Support updating settings values
* Support activity stream endpoint
* Support clearing value
* Improve type conversion system for displaying values
2015-12-14 15:09:10 -05:00
Matthew Jones f53f3d805d View and some validation logic for database config
* Fixing some bugs in the manifest definition
* Database model and schema migration for tower settings
* Initial View and Serializer implementation using a strategy of merging
  model instances and named tuples
2015-12-11 16:57:11 -05:00
Matthew Jones 87e50734a6 Merge branch 'release_2.4.2' into devel
* release_2.4.2: (23 commits)
  Updating 2.4.2 changelogs
  fix the connection check fix
  more robust check added to mongo db connection
  Adding a body to our OPTIONS requests fixes 415 error responses in IE11 and Edge.
  Don't hard-fail if default isn't defined on survey
  fixed custom login info bug
  Allow an org admin to delete project updates
  Disable elasticache instance gathering for aws
  Fix DEB builds by adding 2.4.2 to reprepro conf
  When the panel lists were consolidated down the list name was changed to 'all_jobs.'  When a job is clicked from the activity stream it should show the job list filtered down by ID.
  Rolled back job url change
  track modules on system tracking page by index
  correct spelling of consisting in help text
  Fixing up flake8
  The "job" href links in the activity stream don't point to the job details page.  This is an update to the jobs href to point to /#/jobs/(job.id).
  Wrapped the SourceChange call in a function so that it can be called without clearing the credential.  This fixes a bug where the credential was not showing up in the initial edit dialog even though the data was sent properly via the API.
  Revert change to Makefile, which was causing old .deb versions to be dropped from the repo
  Refactor scan_packages for os detection
  Remove stray debugging lines
  Add SUSE, OpenSuse and Debian to scan_packages
  ...
2015-12-09 13:06:47 -05:00
Matthew Jones fdcda43de6 Initial Database Configuration bootstrap
* Settings manifest, mapping internal settings to what can be used in
  the database along with type information etc.
* Initial Database model
* Helper object that overlays database settings on django settings
2015-12-07 09:49:13 -05:00
Matthew Jones 780b27e0ed Don't hard-fail if default isn't defined on survey 2015-12-02 15:40:56 -05:00
Matthew Jones e79db58b6d Allow an org admin to delete project updates
Only in their purview (where they can delete or change the original
project)

Plus a bonus unit test!
2015-12-01 16:02:10 -05:00
Matthew Jones f33e17826f Disable elasticache instance gathering for aws 2015-12-01 14:45:35 -05:00
Matthew Jones 5d3da1460f Fixing up flake8 2015-11-30 11:13:37 -05:00
Matthew Jones a1fbee4fa0 Refactor scan_packages for os detection
* Use setup facts ansible_os_family for os family detection now.  Add
  support for Suse and it's ilk (which has a pretty ugly OS family
  implementation
2015-11-24 14:19:09 -05:00
Matthew Jones d95470066c Remove stray debugging lines 2015-11-24 12:35:39 -05:00
Matthew Jones 772b7d201e Add SUSE, OpenSuse and Debian to scan_packages
Also strip the output of get_distribution() since the suse variants seem
to have extra whitespace in the string output.
2015-11-24 12:15:37 -05:00
Matthew Jones 13c80375ea Fix job template job sorting
"started" isn't a good field to sort on as it can be Null.  "created"
will always be available.
2015-11-24 11:22:50 -05:00
Matthew Jones e69fdfa79b Improvements to the package scanner
* Support Amazon (because it's RH based)
* Switch to using module_utils's get_distribution() method
  for more efficient distro detection
2015-11-24 11:20:27 -05:00
Matthew Jones 68d7119337 Bump minor version for 2.4.2 release 2015-11-24 09:51:48 -05:00
Matthew Jones 3d30ad2db2 Updates for fixes on the core ec2 inventory module
Inventory syncs will still fail if you specify an instance_filter.  We
need to check:

https://github.com/ansible/ansible/pull/13178

For the moment I'm making sure we specifically disable elasticache
querying but it still yields an error.

Will follow up with:

https://trello.com/c/h1U0w4WC/138-ec2-module-is-busted-if-you-set-instance-filters
2015-11-23 14:22:36 -05:00
Matthew Jones 76b02cde05 Fix job template job sorting
"started" isn't a good field to sort on as it can be Null.  "created"
will always be available.
2015-11-23 13:42:39 -05:00
Matthew Jones d8831dedeb Merge branch 'release_2.4.1' into devel
* release_2.4.1:
  Update reprepro component version
  vendoring ng-pendo as an Tower module
  Updating version number and changelog for 2.4.1
  Fix up location of apt key for mongo
2015-11-23 12:22:32 -05:00
Matthew Jones e646715773 Merge branch 'release_2.4.0' into devel
* release_2.4.0: (24 commits)
  CheckAccess for related fields for teams
  Don't save the instance in set_actor if the user is invalid
  fixed related values not populating in teams ui
  update to more performant and 2.7.9 SSL-friendlier version of pywinrm
  added dm.xmlsec.bindin license
  stop waiting after summary fields are grabbed
  Remove social auth user fields settings that don't have any effect.
  fixed social authd user license issue
  Remove cedric-vincent proot repo
  Updating changelogs and readme
  Fix typo in AnonymousUser
  Fix an issue reauthing as a social auth user
  fixed organization rest call from happening
  fixed messing up add user form w social auth pw hide earlier
  Update response object nesting for pendo service
  update requirements.txt README
  hide un and pw fields when user is social auth based
  add pyrad to requirements.txt
  added appdirs
  add django-radius license
  ...
2015-11-23 12:19:37 -05:00
Matthew Jones fa0d4f180b Updating version number and changelog for 2.4.1 2015-11-19 09:17:49 -08:00
Matthew Jones 7ffbb2dac6 Don't save the instance in set_actor if the user is invalid 2015-11-18 07:27:52 -05:00
Matthew Jones e8d420abeb Updating changelogs and readme 2015-11-17 13:36:05 -05:00
Matthew Jones 98965d4792 Fix typo in AnonymousUser 2015-11-17 12:46:50 -05:00
Matthew Jones 564f9e2c58 Fix an issue reauthing as a social auth user
If a social auth user is deleted and then attemnpts to relogin after the
old user object has been removed then it can cause an error.  So here
we'll add an extra lookup for the user just to verify
2015-11-17 12:42:33 -05:00
Matthew Jones 3b07773bcd Merge branch 'release_2.4.0' into devel
* release_2.4.0: (70 commits)
  Disallow changing a users password for social auth
  bump django-radius to include new license
  Change Jenkins server references from IP to DNS name
  Social auth and SSO updates:
  allow multi-org expired licenses to delete orgs
  Add social log messages to tower's log on error
  Update default scopes requested for github social auth.
  Switch to matburt's fork for python social auth
  Emit a warning for unmapped SAML paramters
  Fix up some SAML issues
  Remove `environment` play stmt
  Use correct aw_repo_url when building packer
  Add missing libxmlsec1 openssl dependency for ubuntu
  adds socket tests
  added git pre commit hook to run flake8
  fixes remove_instance error
  null pointer exception
  Resolve issue on precise keeping old debs around
  Attach handlers to django_auth_ldap
  Attach handlers to django_auth_ldap
  ...
2015-11-16 15:12:37 -05:00
Matthew Jones dfb056d200 Disallow changing a users password for social auth 2015-11-16 10:09:22 -05:00
Matthew Jones 4832f48e06 Add social log messages to tower's log on error 2015-11-12 13:47:17 -05:00
Matthew Jones 7f276b03fb Switch to matburt's fork for python social auth
This picks up the change needed for python 2.6 to work
2015-11-11 16:06:37 -05:00
Matthew Jones 5f321ecab6 Emit a warning for unmapped SAML paramters 2015-11-11 16:05:53 -05:00
Matthew Jones fdc9979595 Fix up some SAML issues
* Fix an issue I created overriding authenticate
* Fix up attribute mapping using an identity provider class.  The
  methods built into django-social-auth for saml are probably not going
  to work.  We also now expose those mappings in a settings attrs map
  that the user can override.
2015-11-10 11:58:42 -05:00
Matthew Jones b2cfd38a1c Update dm.xmlsec.bindings requirement to point to a version with updated cflags 2015-11-04 16:43:06 -05:00
Matthew Jones f78f69159d Fix up pyflakes indentation issues 2015-11-04 09:50:50 -05:00
Matthew Jones ec6ef4974a Update GCE Region Choices per Google 2015-11-03 23:34:46 -05:00
Matthew Jones 99f048dfe5 Add object_association for m2m relationships
Now when displaying a m2m relationship change we'll show the related
field mapping that changed.
2015-11-02 14:39:24 -05:00
Matthew Jones 113c5ed78f Clean up authenticate and get_user for ldap auth 2015-11-02 12:02:14 -05:00