Commit Graph

647 Commits

Author SHA1 Message Date
Jason Gerard DeRose
36737c2d91 Added frontend.LocalOrRemote command base class for commands like env 2008-11-14 21:29:46 -07:00
Jason Gerard DeRose
3433840692 Fixed doctest in tutorial 2008-11-14 19:48:01 -07:00
Rob Crittenden
c513743e7c Add autmount-specific location and default entries 2008-11-14 18:05:29 -05:00
Jason Gerard DeRose
f8f4058014 Tutorial: fixed typo in 'How your command should print to stdout' section 2008-11-14 14:53:55 -07:00
Jason Gerard DeRose
caa98476f0 Tutorial: fixed typo in 'First steps: A simple command plugin' section 2008-11-14 14:49:48 -07:00
Jason Gerard DeRose
1abe3abb87 Tutorial: another small change to section on using output_for_cli() 2008-11-14 14:35:52 -07:00
Jason Gerard DeRose
0f1ed3e904 Tutorial: command in output_for_cli() example now also takes an argument 2008-11-14 14:27:09 -07:00
Jason Gerard DeRose
c974451edf Added print_plain() and print_paragraph() methods to textui plugin and cleaned up the order of its methods 2008-11-14 13:33:42 -07:00
Jason Gerard DeRose
6d1ec6360c Tutorial: small improvements to section on using output_for_cli() 2008-11-14 12:43:10 -07:00
Jason Gerard DeRose
0313bb7ec0 Tutorial: added section on implementing an output_for_cli() method 2008-11-14 12:19:18 -07:00
Jason Gerard DeRose
44171a0bad Tutorial: added section on allowed return values from a command's execute() method 2008-11-14 01:25:05 -07:00
Jason Gerard DeRose
82d3de773b Added textui.prompt() method, which CLI.prompt_interactively() uses 2008-11-13 23:54:34 -07:00
Jason Gerard DeRose
f5594dd489 Started work on cleaning up how exceptions are caught and sys.exit() is called in ipalib.cli.CLI 2008-11-13 23:29:35 -07:00
Jason Gerard DeRose
860d391f3e Change Param.__repr__() so it returns the exact expression that could create it; added unit test for Param.__repre__() 2008-11-13 22:16:04 -07:00
Jason Gerard DeRose
1f635269e8 Param.__repr__() now uses util.make_repr() 2008-11-13 21:17:33 -07:00
Jason Gerard DeRose
8ad5502354 Added util.make_repr() function; added corresponding unit tests 2008-11-13 21:07:47 -07:00
Jason Gerard DeRose
01a7f1f437 Calling ./ipa with no command now calls Command.help() 2008-11-12 10:15:24 -07:00
Jason Gerard DeRose
f04aaff97c output_for_cli signature is now output_for_cli(textui, result, *args, **options) 2008-11-12 09:55:11 -07:00
Jason Gerard DeRose
09161e399a Command.get_default() will now fill-in None for all missing non-required params 2008-11-12 01:47:37 -07:00
Jason Gerard DeRose
014af24731 Changed calling signature of output_for_cli(); started work on 'textui' backend plugin 2008-11-12 00:46:04 -07:00
Jason Gerard DeRose
f3869d7b24 Renamed ipalib.get_standard_api() to create_api() 2008-11-11 15:24:18 -07:00
Jason Gerard DeRose
1894513574 Tutorial: improved clarity of 'How this tutorial is written' section 2008-11-11 10:24:30 -07:00
Jason Gerard DeRose
786c965c12 Tutorial: fixed typo 2008-11-10 21:36:56 -07:00
Jason Gerard DeRose
16b86d559a Tutorial: added intro section about Python interactive intepreter 2008-11-10 21:33:15 -07:00
Jason Gerard DeRose
2be9f2bba8 More tutorial work: made introduction more concise; moved note on markup to end; added note about Bazaar 2008-11-10 20:08:22 -07:00
Jason Gerard DeRose
9aa14333a4 Added 'conf_dir' env variable, which is directory containing config files 2008-11-10 15:53:10 -07:00
Jason Gerard DeRose
174af50f6d Fixed typo and made sentance clearer in tutorial 2008-11-07 02:30:19 -07:00
Jason Gerard DeRose
c26a3c8542 Finished fist draft of plugin tutorial in ipalib/__init__.py docstring 2008-11-07 02:26:38 -07:00
Jason Gerard DeRose
5bdf860647 Added Plugin.call() method that calls an external executable via subprocess.call() 2008-11-06 11:57:21 -07:00
Rob Crittenden
e8adb59fd4 Fix some problems uncovered during automation test work 2008-11-04 16:21:10 -05:00
Rob Crittenden
e825bc7ccb Revive the hostgroup_container and include add/remove hosts in hostgroups plugin 2008-11-04 14:03:43 -05:00
Rob Crittenden
4967002359 Add 'all' option to host-find and pull attributes into a global list 2008-11-04 14:02:42 -05:00
Rob Crittenden
f131480643 Move socket errors from the XML-RPC plugin to the client 2008-11-03 17:38:05 -05:00
Rob Crittenden
d53218a932 Handle exceptions in the command-line instead of in the XMLRPC client plugin 2008-11-03 17:19:29 -05:00
Rob Crittenden
dd9206deb6 Uncomment some logging statements ported over from v1. 2008-11-03 13:14:46 -05:00
Rob Crittenden
f18c84444d Partially revert back change. Del shouldn't provide default options.
It can provide custom ones though, if defined with takes_params() in the class.
2008-11-03 13:14:46 -05:00
Jason Gerard DeRose
242a8183a7 Added custom log formatter util.LogFormatter that makes the human-readable time stamp in UTC 2008-10-31 20:25:33 -06:00
Jason Gerard DeRose
5e5a83e4e8 Renamed API.bootstrap_from_options() to bootstrap_with_global_options() 2008-10-31 19:03:07 -06:00
Jason Gerard DeRose
5269d1396c Logging formats are now env variables; added log_format_stderr_debug format used when env.debug is True 2008-10-31 18:55:32 -06:00
Jason Gerard DeRose
a23d41a57f Reoganized global option functionality to it is easy for any script to use the environment-related global options; lite-xmlrpc.py now uses same global options 2008-10-31 18:17:08 -06:00
Jason Gerard DeRose
cdfb7bfd5e Logging is now configured in API.bootstrap(); removed depreciated util.configure_logging() function 2008-10-31 13:27:42 -06:00
Jason Gerard DeRose
140458cfc6 API.finalize() now cascades call to API.load_plugins() 2008-10-31 12:29:59 -06:00
Jason Gerard DeRose
3352069309 Merge branch 'master' of git://git.engineering.redhat.com/users/rcritten/freeipa2 2008-10-30 17:05:07 -06:00
Rob Crittenden
62876ccee3 Initial implementation of automount support
Add argument handling to crud.Del
Make get_list handle LDAP scope
2008-10-30 17:29:22 -04:00
Jason Gerard DeRose
3076cb4d2f Plugin.set_api() now sets convience instance attributes from api for env, context, log, and all NameSpace 2008-10-30 14:11:24 -06:00
Jason Gerard DeRose
6879140db7 Added ipalib.plugins.f_misc with new 'context' Command; moved 'env' Command from cli to f_misc 2008-10-30 02:20:28 -06:00
Jason Gerard DeRose
2fee6a3e20 Added tests.util.get_api() function to create a standard (api, home) tuple for unit testing 2008-10-30 01:34:46 -06:00
Jason Gerard DeRose
ddb5449c7f Did some initial work for Context plugins 2008-10-30 01:11:33 -06:00
Jason Gerard DeRose
9f45cdbe2f Merge branch 'master' of git://git.engineering.redhat.com/users/rcritten/freeipa2 2008-10-29 18:10:38 -06:00
Jason Gerard DeRose
138305b365 Added an example CLI-specific env command 2008-10-28 02:23:13 -06:00
Jason Gerard DeRose
fbcb55bd11 lite-xmlrpc.py now uses api.bootstrap() property, logs to api.logger 2008-10-28 02:10:56 -06:00
Jason Gerard DeRose
a9f1c74a7f util.configure_logging() now only configures file logging if it can create the log_dir 2008-10-28 01:45:02 -06:00
Jason Gerard DeRose
316bd855d5 Added util.configure_logging() function; API.bootstrap() now calls util.configure_logging() 2008-10-28 01:39:02 -06:00
Jason Gerard DeRose
2307d4ddd0 Fixed use of depreciated env.get() in b_xmlrpc.py module 2008-10-27 23:56:22 -06:00
Jason Gerard DeRose
83d6c95e46 API.load_plugins() no longer takes dry_run=False kwarg and instead checks in env.mode == 'unit_test' to decide whether to load the plugins; it also only loads ipa_server.plugins in env.in_server is True 2008-10-27 23:39:43 -06:00
Jason Gerard DeRose
6e456cc749 More CLI cleanup, got all basics working again 2008-10-27 23:30:55 -06:00
Jason Gerard DeRose
9b1e3f5946 More docstrings, functionality, and unit tests for improved CLI class 2008-10-27 19:21:49 -06:00
Jason Gerard DeRose
bb9691099b API.bootstrap() now calls Env._finalize_core(); updated unit tests 2008-10-27 15:36:41 -06:00
Jason Gerard DeRose
e6254026fe Implemented basic CLI.bootstrap(); added corresponding unit tests 2008-10-27 15:19:49 -06:00
Jason Gerard DeRose
17fd9cc431 Started cleanup work on CLI class, added unit tests for CLI.parse_globals() 2008-10-27 14:49:34 -06:00
Jason Gerard DeRose
10026284db Started cleanup work on CLI class, added unit tests for CLI.parse_globals() 2008-10-27 14:48:02 -06:00
Rob Crittenden
54f37503d2 Implement host groups 2008-10-27 12:24:17 -04:00
Rob Crittenden
201a963930 Fix comment 2008-10-27 12:23:49 -04:00
Jason Gerard DeRose
d76202fea3 API.env is now an Env instance rather than an Environment instance 2008-10-27 01:35:40 -06:00
Jason Gerard DeRose
25a7df9615 Env._finalize_core() now also loads config from Env.conf_default 2008-10-27 01:09:53 -06:00
Jason Gerard DeRose
28dd8e74bd Env._bootstrap() now also sets Env.conf_default 2008-10-27 00:58:25 -06:00
Jason Gerard DeRose
c8b3f65165 Removed depreciated load_plugins.py module; changed all places where load_plugins was imported to now call api.load_plugins() 2008-10-27 00:41:37 -06:00
Jason Gerard DeRose
03accc5fb3 Copied plugin loading function from load_plugins.py to util.py; API.load_plugins() method now calls functions in util 2008-10-27 00:23:43 -06:00
Jason Gerard DeRose
4fe03f5e17 Added API.load_plugins() place-holder, which cascades call to API.bootstrap() 2008-10-26 23:53:44 -06:00
Jason Gerard DeRose
6b8abb0d78 Implemented placeholder API.bootstrap() method; added API __doing(), __do_if_not_done(), isdone() methods borrowed from Env; API.finalize() now cascades call to API.bootstrap() 2008-10-26 23:28:06 -06:00
Jason Gerard DeRose
ff5cb4cf6f Added more needed config in DEFAULT_CONFIG 2008-10-24 20:59:11 -06:00
Jason Gerard DeRose
759734864e Finished Env._finalize() and corresponding unit tests 2008-10-24 20:21:27 -06:00
Jason Gerard DeRose
ac4efac394 Finished Env._finalize_core() and corresponding unit tests 2008-10-24 20:02:14 -06:00
Jason Gerard DeRose
2a41db33c6 Env._bootstrap() now raises StandardError if called more than once 2008-10-24 15:35:58 -06:00
Jason Gerard DeRose
39dfffd280 Merge branch 'master' of git://git.engineering.redhat.com/users/rcritten/freeipa2 2008-10-24 15:11:27 -06:00
Jason Gerard DeRose
f80beb948b Added ipalib/constants.py; added Env._load_config() method along with comprehensive unit tests for same 2008-10-24 15:07:07 -06:00
Rob Crittenden
34520981ee Don't allow service-add to create host/ principals 2008-10-24 14:17:20 -04:00
Rob Crittenden
8788afe184 Use posixAccount instead of person to identify users
Add output_for_cli to service-find
2008-10-24 11:41:39 -04:00
Rob Crittenden
6a8026f974 If a password is supplied then this host will be bulk-enrolled
A bulk-enrolled host does not get a kerberos service principal until
enrollment time.
2008-10-24 11:41:38 -04:00
Jason Gerard DeRose
2ec0312eb6 Finished doodle with stricter version of Environment 2008-10-24 01:51:36 -06:00
Jason Gerard DeRose
59a2cffff4 IPAError now more appropriately subclasses from StandardError instead of Exception 2008-10-23 21:21:51 -06:00
Rob Crittenden
d2b46f176e Use common display function for user-show and user-find.
Add --all option to user-find
Fix command-line help to make sense on searches as well
2008-10-23 14:36:24 -04:00
Rob Crittenden
06a82bf4b6 Fix ipa command running in server_context=True
Make the LDAP host and port environment variables
More changes so that commands have a shell return value
lite-xmlrpc no longer hardcodes the kerberos credentials cache location
2008-10-23 11:00:50 -04:00
Rob Crittenden
1daf319a19 Implement the host commands
In order for this to work against a v1 database the update host.update needs to
be applied
2008-10-22 17:54:04 -04:00
Rob Crittenden
f189b02996 Return a value to the shell that called ipa 2008-10-22 17:52:32 -04:00
Jason Gerard DeRose
f8ffede3b9 Merge branch 'master' of git://git.engineering.redhat.com/users/rcritten/freeipa2 2008-10-21 17:35:42 -06:00
Rob Crittenden
245969858d Implement group member add/remove
Add gidNumber to the group command-line
2008-10-21 16:33:34 -04:00
Rob Crittenden
3cbb5c6eeb Don't import servercore 2008-10-21 16:32:45 -04:00
Rob Crittenden
8d07faed4d Update the command-line options to more closely match v1 2008-10-21 16:32:30 -04:00
Rob Crittenden
bc5edcf893 Gracefully handle keyboard interrupts (^C) 2008-10-21 14:42:13 -04:00
Jason Gerard DeRose
5e0a0fa745 In second example in NameSpace docstring, renamed 'member' class to 'Member' to make the example clearer 2008-10-21 08:47:08 -06:00
Jason Gerard DeRose
603baf6b10 Fixed typos in tables in docstrings for Attribute and Method 2008-10-21 08:42:52 -06:00
Rob Crittenden
475265ed37 Implement --all option to display all attributes.
Still need to strip the dn when not doing all.
2008-10-21 09:32:48 -04:00
Rob Crittenden
6b998ed479 Make boolean options work like standard OptionParser booleans 2008-10-21 09:32:48 -04:00
Jason Gerard DeRose
658ba6dc33 Merge branch 'master' of git://git.engineering.redhat.com/users/rcritten/freeipa2 2008-10-20 22:32:10 -06:00
Rob Crittenden
8c54f730c0 Framework for doing password changes
Need mechanism to prompt for new password twice and verify they are the same
2008-10-20 22:41:53 -04:00
Jason Gerard DeRose
461f547e6a Added docstring (with example) to frontend.Attribute class 2008-10-20 20:28:24 -06:00
Jason Gerard DeRose
c818fe1d2d Added docstring (with examples) to frontend.Method class 2008-10-20 19:57:02 -06:00
Jason Gerard DeRose
ac0a019605 Reworked 'plugins' command to use output_for_cli() 2008-10-20 18:57:03 -06:00
Jason Gerard DeRose
bb978e591b Fixed bug in DefaultFrom where impleied keys were using entire func_code.co_varnames instead of an approprate slice 2008-10-20 16:45:32 -06:00
Rob Crittenden
d615e4dafb Port pwpolicy plugin to use b_ldap
Add basic output_for_cli() function to user-show
2008-10-20 16:12:19 -04:00
Martin Nagy
18e74643a6 Add comments in config.py and fix Environment.get() 2008-10-20 19:54:30 +02:00
Jason Gerard DeRose
77a378bd61 Some PEP-257 and reStructuredText cleanup in plugable.py 2008-10-18 01:02:31 -06:00
Jason Gerard DeRose
5c5641e8c2 Added some more examples to Param docstrings 2008-10-18 00:16:22 -06:00
Jason Gerard DeRose
675fadc641 Some PEP-257 and reStructuredText fixes in ipalib/aci.py, ipa_server/ipaldap.py 2008-10-17 23:25:50 -06:00
Jason Gerard DeRose
80ccf8b1c6 Reworked load_plugins so it doesn't use imp.load_module() to load from the plugins/ sub-packages, which previously caused them to be loaded multiple times when runnig the doctests 2008-10-17 22:09:50 -06:00
Jason Gerard DeRose
721982870e Removed generic Command.output_for_cli() method; CLI.run_interactive() now only calls output_for_cli() if it has been implemented 2008-10-17 21:05:03 -06:00
Jason Gerard DeRose
f1eb74e22c make-test now runs doctests also; fixed several broken doctests 2008-10-17 20:50:34 -06:00
Jason Gerard DeRose
8322138f38 Added new Param.flags attribute (set with flags=foo kwarg) 2008-10-17 19:34:26 -06:00
Jason Gerard DeRose
f7b7fa5553 Cleaned up ipalib package-level docstring, removed broken cross-referce to 2008-10-17 19:11:26 -06:00
Martin Nagy
3a80297b04 Reworking Environment, moved it to config.py 2008-10-17 23:11:51 +02:00
Rob Crittenden
ae8370be44 Port f_service to LDAP backend
Add new keyword, 'filter', that can be passed to the search function.
This is globbed onto the filter that is auto-created.
2008-10-17 19:20:23 -04:00
Rob Crittenden
b045f22069 Add mod_python-based XML-RPC server.
Use -e kerberos on the command-line to use the mod_python server, otherwise
it defaults to use the simple-server URL.
2008-10-16 23:33:44 -04:00
Rob Crittenden
f777f72de6 Use the search fields from the configuration when searching
Generalize the attribute -> objectclass search helper
2008-10-16 15:00:30 -04:00
Rob Crittenden
5748fce84c Remove references to ipa_server.* and port group plugin to ldap backend 2008-10-16 10:59:03 -04:00
Rob Crittenden
12f1e7fdf7 Remove all references to ipa_server.* from user plugin 2008-10-16 10:32:20 -04:00
Rob Crittenden
1a8317ff74 Port group-add to use LDAP backend
Have create and update return the record that was just added/modified
2008-10-15 17:46:01 -04:00
Rob Crittenden
14a33d4619 Fix some remaining merge issues and don't use forward() in user-*lock() 2008-10-15 16:50:46 -04:00
Rob Crittenden
3268b65ae0 Initial implementation of a generic search routine. 2008-10-15 16:12:27 -04:00
Jason Gerard DeRose
af7c0ee595 Resolved conficts in Rob's merge 2008-10-15 12:24:15 -06:00
Rob Crittenden
789a248daa Port user-mod to use ldap update() method 2008-10-15 09:58:29 -04:00
Rob Crittenden
e7937f2944 Add missing * to *kw to make it pass named arguments instead of positional 2008-10-15 09:57:49 -04:00
Rob Crittenden
f7c044495a Port user_del to CrudBackend
Override output_for_cli() to generate nicer output
2008-10-14 22:48:57 -04:00
Rob Crittenden
cfc8450efd Port user-show to new CrudBackend framework 2008-10-14 22:22:01 -04:00
Rob Crittenden
1c3f81852c Move some functionality from user-add to the backend ldap create function 2008-10-14 21:28:06 -04:00
Jason Gerard DeRose
0ebdbaa450 Merge branch 'master' of git://git.engineering.redhat.com/users/rcritten/freeipa2 2008-10-14 15:45:57 -06:00
Rob Crittenden
30664cde88 Move some functionality from user-add to the backend ldap create function 2008-10-14 17:46:36 -04:00
Martin Nagy
ff88652a40 Convert string values to boolean when generating environment 2008-10-14 21:22:44 +02:00
Jason Gerard DeRose
9788800aa4 More work on making user-add use Backend.ldap 2008-10-14 02:23:56 -06:00
Jason Gerard DeRose
1480224724 Started roughing out user_add() using api.Backend.ldap; added Command.output_for_cli() to take care of formatting print output 2008-10-14 01:45:30 -06:00
Jason Gerard DeRose
20fa90cfb6 Some small cleanup on Environment, filled in docstrings 2008-10-14 00:39:23 -06:00
Jason Gerard DeRose
149912d0e7 Added ldap.get_user_dn() method 2008-10-14 00:38:17 -06:00
Jason Gerard DeRose
446037fd60 Added Object.get_dn() method; added corresponding unit tests 2008-10-13 23:26:24 -06:00
Jason Gerard DeRose
22669f1fc2 CLI.run_interactive() now uses Param.cli_name instead of Param.name for prompts and errors 2008-10-13 22:00:18 -06:00
Jason Gerard DeRose
2357360e2a Command.params are now sorted the same way as Object.params (make user-add prompt for first, last before login) 2008-10-13 21:53:03 -06:00
Jason Gerard DeRose
b6dcd183a6 CLI now maps Param.cli_name to Param.name 2008-10-13 20:31:10 -06:00
Jason Gerard DeRose
8674086b85 Param now takes cli_name kwarg that sets Param.cli_name attribute 2008-10-13 17:24:23 -06:00
Jason Gerard DeRose
367143adf3 Merge branch 'master' of git://git.engineering.redhat.com/users/rcritten/freeipa2 2008-10-13 15:39:14 -06:00
Rob Crittenden
6d2705b363 Implement user lock and unlock 2008-10-13 17:17:00 -04:00
Rob Crittenden
19465318ce Fix up a comment 2008-10-13 15:17:31 -04:00
Rob Crittenden
fc9f057792 Initial implementation of password policy 2008-10-13 15:01:08 -04:00
Rob Crittenden
0ebaad6462 Do a more specific search for the user 2008-10-13 14:59:48 -04:00
Jason Gerard DeRose
225e2b0c93 Added CrudBackend abstract class defining generic CRUD API 2008-10-13 09:50:29 -06:00
Rob Crittenden
39ad5ccffa Stub out delegations
Add ACI class
2008-10-11 00:49:05 -04:00
Rob Crittenden
250734aea5 Fix syntax error 2008-10-10 14:38:09 -04:00
Rob Crittenden
75bad44c27 Enable the verbose flag to pass thru xmlrpc 2008-10-10 05:23:00 -04:00
Rob Crittenden
42cdca3e83 Use new options handler 2008-10-10 03:40:52 -04:00
Rob Crittenden
dbe49423ab Start service principal plugin 2008-10-10 03:36:57 -04:00
Rob Crittenden
5d2a99925d Implement group-mod 2008-10-10 03:36:57 -04:00
Rob Crittenden
8a97b3e8a8 Implement group-del 2008-10-10 03:36:57 -04:00