File tree Expand file tree Collapse file tree 2 files changed +4
-11
lines changed
Expand file tree Collapse file tree 2 files changed +4
-11
lines changed Original file line number Diff line number Diff line change 1919from munch import unmunchify
2020
2121from riocli .config import new_v2_client
22- from riocli .constants import Colors , Symbols
22+ from riocli .constants import Colors
2323from riocli .organization .util import name_to_guid as name_to_organization_guid
2424from riocli .utils import tabulate_data
2525
@@ -74,13 +74,6 @@ def list_projects(
7474 """
7575 # If organization is not passed in the options, use
7676 organization_guid = organization_guid or ctx .obj .data .get ("organization_id" )
77- if organization_guid is None :
78- err_msg = (
79- "Organization not selected. Please set an organization with "
80- "`rio organization select ORGANIZATION_NAME` or pass the --organization option."
81- )
82- click .secho ("{} {}" .format (Symbols .ERROR , err_msg ), fg = Colors .RED )
83- raise SystemExit (1 )
8477
8578 query = {"labelSelector" : labels }
8679
Original file line number Diff line number Diff line change @@ -71,11 +71,11 @@ def list_projects(
7171 query : Optional [dict ] = None ,
7272 ) -> Munch :
7373 """
74- List all projects in an organization
74+ List all projects in an organization or where user have the access to in all organizations.
7575 """
7676
7777 url = "{}/v2/projects/" .format (self ._host )
78- headers = self ._get_auth_header (with_project = False )
78+ headers = self ._get_auth_header (with_project = False , with_organization = False )
7979
8080 params = {}
8181
@@ -96,7 +96,7 @@ def get_project(self, project_guid: str) -> Munch:
9696 Get a project by its GUID
9797 """
9898 url = "{}/v2/projects/{}/" .format (self ._host , project_guid )
99- headers = self ._get_auth_header ()
99+ headers = self ._get_auth_header (with_organization = False )
100100 response = RestClient (url ).method (HttpMethod .GET ).headers (headers ).execute ()
101101
102102 handle_server_errors (response )
You can’t perform that action at this time.
0 commit comments