Giter Club home page Giter Club logo

safire's People

Contributors

88lex avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

safire's Issues

Error thrown if drive filter excludes all drives

I have no shared drives with BAZ in the name:

(safire-venv) ➜  safire git:(master) ✗ ./safire.py list drives BAZ
Traceback (most recent call last):
  File "./safire.py", line 701, in <module>
    main()
  File "./safire.py", line 697, in main
    fire.Fire(Commands)
  File "/opt/safire/safire-venv/lib/python3.8/site-packages/fire/core.py", line 141, in Fire
    component_trace = _Fire(component, args, parsed_flag_args, context, name)
  File "/opt/safire/safire-venv/lib/python3.8/site-packages/fire/core.py", line 466, in _Fire
    component, remaining_args = _CallAndUpdateTrace(
  File "/opt/safire/safire-venv/lib/python3.8/site-packages/fire/core.py", line 681, in _CallAndUpdateTrace
    component = fn(*varargs, **kwargs)
  File "./safire.py", line 88, in drives
    self._export(drivelist, filter, file_tag, ["id", "name"], "drives", prt)
  File "/opt/safire/safire/utils.py", line 44, in _export
    print(df[fields])
  File "/opt/safire/safire-venv/lib/python3.8/site-packages/pandas/core/frame.py", line 3464, in __getitem__
    indexer = self.loc._get_listlike_indexer(key, axis=1)[1]
  File "/opt/safire/safire-venv/lib/python3.8/site-packages/pandas/core/indexing.py", line 1314, in _get_listlike_indexer
    self._validate_read_indexer(keyarr, indexer, axis)
  File "/opt/safire/safire-venv/lib/python3.8/site-packages/pandas/core/indexing.py", line 1374, in _validate_read_indexer
    raise KeyError(f"None of [{key}] are in the [{axis_name}]")
KeyError: "None of [Index(['id', 'name'], dtype='object')] are in the [columns]"

storage space remains at 0

hello,

When using account services with sasync, the storage space remains at 0 despite having copied 10 T to shared drive, is that normal?

Thanks

How to generate JSON only for some projects?

Quick question.
Let’s say I’ve ran Safire in the past and generated the projects, accounts and SAs json files.
Now I have the need to add more projects so I don’t need to re-generate the json of all the projects but just of the new ones.

there is a way to make it generate just the the json from that give project?

I’ve tried already to insert in the brackets of the command the project name, j have a confirmation message but the folder after the execution is empty.

What am I doing wrong?

unable to create groups

Unable to create groups : safire add members "" [email protected]
Traceback (most recent call last):
File "/usr/local/bin/safire", line 8, in
sys.exit(main())
File "/usr/local/lib/python3.7/dist-packages/safire/safire.py", line 697, in main
fire.Fire(Commands)
File "/usr/local/lib/python3.7/dist-packages/fire/core.py", line 138, in Fire
component_trace = _Fire(component, args, parsed_flag_args, context, name)
File "/usr/local/lib/python3.7/dist-packages/fire/core.py", line 468, in _Fire
target=component.name)
File "/usr/local/lib/python3.7/dist-packages/fire/core.py", line 672, in _CallAndUpdateTrace
component = fn(*varargs, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/safire/safire.py", line 467, in members
group_list = self._list.groups(group_filter, file_tag, group_token, prt)
File "/usr/local/lib/python3.7/dist-packages/safire/safire.py", line 146, in groups
grouplist = svc.groups().list(customer="my_customer").execute()["groups"]
File "/usr/local/lib/python3.7/dist-packages/googleapiclient/_helpers.py", line 134, in positional_wrapper
return wrapped(*args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/googleapiclient/http.py", line 915, in execute
raise HttpError(resp, content, uri=self.uri)
googleapiclient.errors.HttpError: <HttpError 403 when requesting https://admin.googleapis.com/admin/directory/v1/groups?customer=my_customer&alt=json returned "Not Authorized to access this resource/api". Details: "Not Authorized to access this resource/api">


Error while running ./safire.py auth projects

So I've just placed the creds.json file into the creds folder and when I run ./safire.py auth projects I get this error:

Traceback (most recent call last):
File "safire.py", line 692, in
main()
File "safire.py", line 688, in main
fire.Fire(Commands)
File "/home/alakh/.local/lib/python3.8/site-packages/fire/core.py", line 138, in Fire
component_trace = _Fire(component, args, parsed_flag_args, context, name)
File "/home/alakh/.local/lib/python3.8/site-packages/fire/core.py", line 463, in _Fire
component, remaining_args = _CallAndUpdateTrace(
File "/home/alakh/.local/lib/python3.8/site-packages/fire/core.py", line 672, in _CallAndUpdateTrace
component = fn(*varargs, **kwargs)
File "/home/alakh/Desktop/safire/safire/utils.py", line 128, in projects
self.get_token(credentials, self.scopes_proj, token)
File "/home/alakh/Desktop/safire/safire/utils.py", line 154, in get_token
flow = InstalledAppFlow.from_client_secrets_file(cred_file[0], scopes)
IndexError: list index out of range

count admin gsuite

Hello,
Thank you very much for your superb work. Just one question, do you absolutely have to be a gsuite administrator to be able to use your project? is it possible by simply having a user account to be able to use it
thank you (sorry for my english i m french)

Error running "auth projects" in Colab

Output:


IndexError Traceback (most recent call last)
in ()
7 sys.argv = [""] + list(command1.split(" "))
8 print(f"safire command: {command1} \n\nOutput: \n")
----> 9 fire.Fire(Commands)
10
11 command2 = "" #@param {type:"string"}

4 frames
/usr/local/lib/python3.6/dist-packages/fire/core.py in Fire(component, command, name)
136 context.update(caller_locals)
137
--> 138 component_trace = _Fire(component, args, parsed_flag_args, context, name)
139
140 if component_trace.HasError():

/usr/local/lib/python3.6/dist-packages/fire/core.py in _Fire(component, args, parsed_flag_args, context, name)
466 component_trace,
467 treatment='class' if is_class else 'routine',
--> 468 target=component.name)
469 handled = True
470 except FireError as error:

/usr/local/lib/python3.6/dist-packages/fire/core.py in _CallAndUpdateTrace(component, args, component_trace, treatment, target)
670 parse = _MakeParseFn(fn, metadata)
671 (varargs, kwargs), consumed_args, remaining_args, capacity = parse(args)
--> 672 component = fn(*varargs, **kwargs)
673
674 if treatment == 'class':

in projects(self, credentials, token)
121 """Create an auth token for accessing and changing projects,
122 service accounts, json keys and drives"""
--> 123 self.get_token(credentials, self.scopes_proj, token)
124
125 def groups(self, credentials=credentials, group_token=group_token):

in get_token(self, credentials, scopes, token)
147 creds.refresh(Request())
148 else:
--> 149 flow = InstalledAppFlow.from_client_secrets_file(cred_file[0], scopes)
150 yes_no = input(
151 "Run local server with browser? If no, generate console link. y/n: "

IndexError: list index out of range

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.