Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't delete a simple queue #4

Open
hernanflecchia opened this issue Oct 28, 2024 · 1 comment
Open

Can't delete a simple queue #4

hernanflecchia opened this issue Oct 28, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@hernanflecchia
Copy link

I have a simple queue named Test in a mikrotik, when I want to delete it like this:

simple = ros.queue.simple(name="Test")[0]
ros.queue.simple.delete(simple)

It breaks and gives me this error:

Traceback (most recent call last):
File "/home/projects/rosrestpy/api_chapa.py", line 16, in
ros.queue.simple.delete(simple)
File "/home/projects/rosrestpy/ros/_base.py", line 75, in delete
return self.remove(o)
File "/home/projects/rosrestpy/ros/_base.py", line 96, in remove
return self.ros.delete_as(self.filename + f"/{self._getid(o)}")
File "/home/projects/rosrestpy/ros/ros.py", line 194, in delete_as
res = self.session.delete(filename)
File "/home/hernan/.local/lib/python3.10/site-packages/requests/sessions.py", line 671, in delete
return self.request("DELETE", url, **kwargs)
File "/home/hernan/.local/lib/python3.10/site-packages/requests/sessions.py", line 575, in request
prep = self.prepare_request(req)
File "/home/hernan/.local/lib/python3.10/site-packages/requests/sessions.py", line 484, in prepare_request
p.prepare(
File "/home/hernan/.local/lib/python3.10/site-packages/requests/models.py", line 367, in prepare
self.prepare_url(url, params)
File "/home/hernan/.local/lib/python3.10/site-packages/requests/models.py", line 438, in prepare_url
raise MissingSchema(
requests.exceptions.MissingSchema: Invalid URL '/queue/simple/*5DB': No scheme supplied. Perhaps you meant https:///queue/simple/*5DB?

If I want to view the queue I execute:

simple = ros.queue.simple(name="Test")
print(simple)

and it returns this:

[SimpleQueue(name='Test', target='', max_limit='0/0', dst=None, burst_limit='0/0', burst_threshold='0/0', burst_time='0s/0s', time=None, disabled=True, comment=None, packet_marks='', limit_at='0/0', priority='8/8', bucket_size='0.1/0.1', queue='default-small/default-small', parent='none', total_bucket_size=None, total_burst_threshold=None, total_limit_at=None, total_priority=None, total_burst_limit=None, total_burst_time=None, total_max_limit=None, total_queue=None, rate='0/0', packet_rate='0/0', queued_bytes='0/0', queued_packets='0/0', bytes='0/0', packets='0/0', dropped='0/0', pcq_queues=None, total_rate='0', total_packet_rate=0, total_queued_bytes='0', total_queued_packets=0, total_bytes='0', total_packets=0, total_dropped=0, total_pcq_queues=None, id='*5DB', dynamic=True, invalid=True)]

the python version is 3.10.12

@hernanflecchia hernanflecchia added the bug Something isn't working label Oct 28, 2024
@hernanflecchia
Copy link
Author

I made this change in ros.py

def delete_as(self, filename: str):
full_url = self.url + filename
#res = self.session.delete(filename)
res = self.session.delete(full_url)
return res.ok

I pass the full url, not just the filename

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant