~juju/ubuntu/quantal/juju/0.6

« back to all changes in this revision

Viewing changes to debian/patches/no-write-sample-on-help.patch

  • Committer: Clint Byrum
  • Date: 2012-04-10 00:16:52 UTC
  • mfrom: (1.1.11)
  • Revision ID: clint@ubuntu.com-20120410001652-1uskc8x0fwpo0r2n
* New upstream snapshot
* d/p/fix-tests-without-aws-key.patch: Dropped as it has been
  superseded by a better upstream fix (LP: #819329)
* d/p/no-write-sample-on-help.patch: Dropped, Applied upstream.
* d/p/disable-failing-zookeeper-test.patch refreshed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Author: Kapil Thangavelu <kapil.thangavelu@canonical.com>
2
 
Origin: http://paste.ubuntu.com/907710/plain/
3
 
Forwarded: yes, r508 in trunk
4
 
Description: write the sample config *after* parser is initialized so that
5
 
 --help does not need to write ~/.juju/environments.yaml
6
 
 
7
 
=== modified file 'juju/control/__init__.py'
8
 
--- a/juju/control/__init__.py  2012-03-28 11:21:58 +0000
9
 
+++ b/juju/control/__init__.py  2012-03-30 19:07:21 +0000
10
 
@@ -159,13 +159,10 @@
11
 
 
12
 
 def main(args):
13
 
     """The main end user cli command for juju users."""
14
 
-    env_config = EnvironmentsConfig()
15
 
-    env_config.load_or_write_sample()
16
 
     parser = setup_parser(
17
 
         subcommands=SUBCOMMANDS,
18
 
         prog="juju",
19
 
         description="juju cloud orchestration admin")
20
 
-    parser.set_defaults(environments=env_config, log=log)
21
 
 
22
 
     # Some commands, like juju ssh, do a further parse on options by
23
 
     # delegating to another command (such as the underlying ssh). But
24
 
@@ -181,5 +178,11 @@
25
 
     else:
26
 
         # Otherwise, do be strict
27
 
         options = parser.parse_args(args)
28
 
+
29
 
+    env_config = EnvironmentsConfig()
30
 
+    env_config.load_or_write_sample()
31
 
+    options.environments = env_config
32
 
+    options.log = log
33
 
+
34
 
     setup_logging(options)
35
 
     options.command(options)
36
 
=== modified file 'juju/control/tests/test_control.py'
37
 
--- a/juju/control/tests/test_control.py        2011-09-15 19:24:47 +0000
38
 
+++ b/juju/control/tests/test_control.py        2012-03-30 22:12:10 +0000
39
 
@@ -29,7 +29,7 @@
40
 
         let the user know it should be edited.
41
 
         """
42
 
         try:
43
 
-            main([])
44
 
+            main(['status'])
45
 
         except EnvironmentsConfigError, error:
46
 
             self.assertTrue(error.sample_written)
47
 
         else:
48