Fix 'podman-compose version' with no compose file in the working directory
Signed-off-by: Davide Madrisan <davide.madrisan@gmail.com>
This commit is contained in:
		
							parent
							
								
									5971f57130
								
							
						
					
					
						commit
						a4b8b5e709
					
				| 
						 | 
					@ -800,7 +800,6 @@ class PodmanCompose:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def run(self):
 | 
					    def run(self):
 | 
				
			||||||
        args = self._parse_args()
 | 
					        args = self._parse_args()
 | 
				
			||||||
        self._parse_compose_file()
 | 
					 | 
				
			||||||
        podman_path = args.podman_path
 | 
					        podman_path = args.podman_path
 | 
				
			||||||
        if podman_path != 'podman':
 | 
					        if podman_path != 'podman':
 | 
				
			||||||
            if os.path.isfile(podman_path) and os.access(podman_path, os.X_OK):
 | 
					            if os.path.isfile(podman_path) and os.access(podman_path, os.X_OK):
 | 
				
			||||||
| 
						 | 
					@ -822,6 +821,8 @@ class PodmanCompose:
 | 
				
			||||||
                exit(1)
 | 
					                exit(1)
 | 
				
			||||||
            print("using podman version: "+self.podman_version)
 | 
					            print("using podman version: "+self.podman_version)
 | 
				
			||||||
        cmd_name = args.command
 | 
					        cmd_name = args.command
 | 
				
			||||||
 | 
					        if (cmd_name != "version"):
 | 
				
			||||||
 | 
					            self._parse_compose_file()
 | 
				
			||||||
        cmd = self.commands[cmd_name]
 | 
					        cmd = self.commands[cmd_name]
 | 
				
			||||||
        cmd(self, args)
 | 
					        cmd(self, args)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue