| 
        
          
        
        
       | 
      
        
  
   Init EnvCommandBase.EnvName from envs.yaml
This change brings 1.18 in line with trunk,
where EnvCommandBase.EnvName is initialised
to the default environment if current-environment
does not exist and neither "-e" nor $JUJU_ENV
have been specified.
The primary change is in moving environcommand.go
to cmd/envcmd, and adding an Init method that
reads from environments.yaml as a last resort.
All commands that embed EnvCommandBase are updated
to call this method, and various tests are updated
as a result.
Fixes lp:1316869
https://code.launchpad.net/~axwalk/juju-core/lp1316869-envcmd-from-yaml-1.18/+merge/218745
(do not edit description out of merge proposal)
   
  
  
    
      Total comments: 2
      
     
  
  
  
   
  
  
  
    
      Total comments: 14
      
     
  
  
  
   
  
  
  
  
    
  
  
    
       | 
      Unified diffs | 
      Side-by-side diffs | 
      Delta from patch set | 
      Stats (+356 lines, -94 lines) | 
      Patch | 
     
    
      
          | 
        A | 
        
          
            [revision details]
          
         | 
        
          
            View
          
         | 
        
        
          1
        
          2
        
         | 
        
          1 chunk | 
          +2 lines, -0 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            cmd/envcmd/environmentcommand.go
          
         | 
        
          
            View
          
         | 
        
        
          1
        
         | 
        
          3 chunks | 
          +26 lines, -2 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            cmd/envcmd/environmentcommand_test.go
          
         | 
        
          
            View
          
         | 
        
        
          1
        
         | 
        
          2 chunks | 
          +76 lines, -18 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        A | 
        
          
            cmd/envcmd/export_test.go
          
         | 
        
          
            View
          
         | 
        
        
         | 
        
          1 chunk | 
          +9 lines, -0 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        D | 
        
          
            cmd/export_test.go
          
         | 
        
          
            View
          
         | 
        
        
         | 
        
          1 chunk | 
          +0 lines, -9 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            cmd/juju/addmachine.go
          
         | 
        
          
            View
          
         | 
        
        
          1
        
         | 
        
          3 chunks | 
          +5 lines, -1 line | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            cmd/juju/addrelation.go
          
         | 
        
          
            View
          
         | 
        
        
          1
        
          2
        
         | 
        
          2 chunks | 
          +5 lines, -1 line | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            cmd/juju/addunit.go
          
         | 
        
          
            View
          
         | 
        
        
          1
        
         | 
        
          3 chunks | 
          +5 lines, -1 line | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            cmd/juju/authorizedkeys_add.go
          
         | 
        
          
            View
          
         | 
        
        
          1
        
         | 
        
          3 chunks | 
          +5 lines, -1 line | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            cmd/juju/authorizedkeys_delete.go
          
         | 
        
          
            View
          
         | 
        
        
          1
        
         | 
        
          3 chunks | 
          +5 lines, -1 line | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            cmd/juju/authorizedkeys_import.go
          
         | 
        
          
            View
          
         | 
        
        
          1
        
         | 
        
          3 chunks | 
          +5 lines, -1 line | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            cmd/juju/authorizedkeys_list.go
          
         | 
        
          
            View
          
         | 
        
        
          1
        
         | 
        
          3 chunks | 
          +9 lines, -1 line | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            cmd/juju/bootstrap.go
          
         | 
        
          
            View
          
         | 
        
        
          1
        
         | 
        
          3 chunks | 
          +5 lines, -1 line | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            cmd/juju/bootstrap_test.go
          
         | 
        
          
            View
          
         | 
        
        
         | 
        
          5 chunks | 
          +17 lines, -9 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            cmd/juju/cmd_test.go
          
         | 
        
          
            View
          
         | 
        
        
         | 
        
          2 chunks | 
          +2 lines, -1 line | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            cmd/juju/constraints.go
          
         | 
        
          
            View
          
         | 
        
        
          1
        
         | 
        
          5 chunks | 
          +9 lines, -2 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            cmd/juju/debuglog_test.go
          
         | 
        
          
            View
          
         | 
        
        
          1
        
          2
        
         | 
        
          1 chunk | 
          +1 line, -1 line | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            cmd/juju/deploy.go
          
         | 
        
          
            View
          
         | 
        
        
          1
        
         | 
        
          3 chunks | 
          +5 lines, -1 line | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            cmd/juju/destroymachine.go
          
         | 
        
          
            View
          
         | 
        
        
          1
        
         | 
        
          3 chunks | 
          +5 lines, -1 line | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            cmd/juju/destroyrelation.go
          
         | 
        
          
            View
          
         | 
        
        
          1
        
          2
        
         | 
        
          2 chunks | 
          +5 lines, -1 line | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            cmd/juju/destroyservice.go
          
         | 
        
          
            View
          
         | 
        
        
          1
        
          2
        
         | 
        
          2 chunks | 
          +5 lines, -1 line | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            cmd/juju/destroyunit.go
          
         | 
        
          
            View
          
         | 
        
        
          1
        
          2
        
         | 
        
          2 chunks | 
          +5 lines, -1 line | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            cmd/juju/endpoint.go
          
         | 
        
          
            View
          
         | 
        
        
          1
        
         | 
        
          2 chunks | 
          +5 lines, -1 line | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            cmd/juju/environment.go
          
         | 
        
          
            View
          
         | 
        
        
          1
        
          2
        
         | 
        
          7 chunks | 
          +14 lines, -4 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            cmd/juju/expose.go
          
         | 
        
          
            View
          
         | 
        
        
          1
        
          2
        
         | 
        
          2 chunks | 
          +5 lines, -1 line | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            cmd/juju/get.go
          
         | 
        
          
            View
          
         | 
        
        
          1
        
         | 
        
          2 chunks | 
          +5 lines, -1 line | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            cmd/juju/plugin.go
          
         | 
        
          
            View
          
         | 
        
        
          1
        
         | 
        
          3 chunks | 
          +5 lines, -1 line | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            cmd/juju/publish.go
          
         | 
        
          
            View
          
         | 
        
        
          1
        
         | 
        
          2 chunks | 
          +5 lines, -1 line | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            cmd/juju/publish_test.go
          
         | 
        
          
            View
          
         | 
        
        
         | 
        
          1 chunk | 
          +3 lines, -5 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            cmd/juju/resolved.go
          
         | 
        
          
            View
          
         | 
        
        
          1
        
         | 
        
          2 chunks | 
          +5 lines, -1 line | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            cmd/juju/retryprovisioning.go
          
         | 
        
          
            View
          
         | 
        
        
          1
        
          2
        
         | 
        
          3 chunks | 
          +5 lines, -1 line | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            cmd/juju/run.go
          
         | 
        
          
            View
          
         | 
        
        
          1
        
         | 
        
          3 chunks | 
          +5 lines, -1 line | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            cmd/juju/set.go
          
         | 
        
          
            View
          
         | 
        
        
          1
        
         | 
        
          2 chunks | 
          +5 lines, -1 line | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            cmd/juju/ssh.go
          
         | 
        
          
            View
          
         | 
        
        
          1
        
          2
        
         | 
        
          3 chunks | 
          +5 lines, -1 line | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            cmd/juju/status.go
          
         | 
        
          
            View
          
         | 
        
        
          1
        
         | 
        
          3 chunks | 
          +5 lines, -1 line | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            cmd/juju/switch.go
          
         | 
        
          
            View
          
         | 
        
        
         | 
        
          3 chunks | 
          +3 lines, -2 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            cmd/juju/switch_test.go
          
         | 
        
          
            View
          
         | 
        
        
         | 
        
          2 chunks | 
          +2 lines, -2 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            cmd/juju/synctools.go
          
         | 
        
          
            View
          
         | 
        
        
          1
        
         | 
        
          3 chunks | 
          +5 lines, -1 line | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            cmd/juju/unexpose.go
          
         | 
        
          
            View
          
         | 
        
        
          1
        
          2
        
         | 
        
          2 chunks | 
          +5 lines, -1 line | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            cmd/juju/unset.go
          
         | 
        
          
            View
          
         | 
        
        
          1
        
         | 
        
          3 chunks | 
          +5 lines, -1 line | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            cmd/juju/upgradecharm.go
          
         | 
        
          
            View
          
         | 
        
        
          1
        
         | 
        
          3 chunks | 
          +5 lines, -1 line | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            cmd/juju/upgradejuju.go
          
         | 
        
          
            View
          
         | 
        
        
          1
        
         | 
        
          3 chunks | 
          +5 lines, -1 line | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            cmd/plugins/juju-metadata/imagemetadata.go
          
         | 
        
          
            View
          
         | 
        
        
          1
        
         | 
        
          3 chunks | 
          +5 lines, -1 line | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            cmd/plugins/juju-metadata/imagemetadata_test.go
          
         | 
        
          
            View
          
         | 
        
        
         | 
        
          2 chunks | 
          +6 lines, -1 line | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            cmd/plugins/juju-metadata/toolsmetadata.go
          
         | 
        
          
            View
          
         | 
        
        
          1
        
         | 
        
          3 chunks | 
          +9 lines, -1 line | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            cmd/plugins/juju-metadata/validateimagemetadata.go
          
         | 
        
          
            View
          
         | 
        
        
          1
        
         | 
        
          4 chunks | 
          +6 lines, -2 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            cmd/plugins/juju-metadata/validateimagemetadata_test.go
          
         | 
        
          
            View
          
         | 
        
        
          1
        
         | 
        
          1 chunk | 
          +2 lines, -0 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            cmd/plugins/juju-metadata/validatetoolsmetadata.go
          
         | 
        
          
            View
          
         | 
        
        
          1
        
         | 
        
          4 chunks | 
          +6 lines, -2 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            cmd/plugins/juju-restore/restore.go
          
         | 
        
          
            View
          
         | 
        
        
          1
        
         | 
        
          3 chunks | 
          +5 lines, -1 line | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
      
          | 
        M | 
        
          
            testing/environ.go
          
         | 
        
          
            View
          
         | 
        
        
         | 
        
          1 chunk | 
          +4 lines, -2 lines | 
        
        
          
            0 comments
            
            
          
         | 
        
          
            Download
          
         | 
       
    
   
 
  
   
  
    
  
  
  Total messages: 7 
  
       |