question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Not any file named q

See original GitHub issue

Hi

using q in an ansible module as follows:

    def exec_module(self):
        changed = False
        result = dict()
        state = self.want.state
        import q
        q.q(state)

There is no file q created anywhere in the file system…

[root@ansible-tower-32 library]# find / -type f -name q -print | wc -l
0

I reckon this is a problem between the chair and the keyboard… any tip would be more than welcome

Thanks!

     Ulises

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
hynekcommented, Aug 2, 2022

I have run into the same problem while trying to debug build backends and I suspect we have the same problem: q respects tempfile.gettmpdir() which for instance in the project I’m working on looks like this:

>>> import tempfile; tempfile.gettempdir()
'/var/folders/7f/5bq0ctcs4tl_7k2721s0ycy80000gn/T'

It would be nice if I could overwrite that with something like Q_FORCE_FILE=/tmp/q.

0reactions
howardjonescommented, Dec 6, 2021

@alonsocamaro did you get this to work in the end? I’m trying to use q to trace an ansible module, and so far it’s just adding to the confusion.

Adding @q decorator to all the module’s internal methods seems to result in /tmp/q just listing them all. Using @q.t gives the expected parameters etc in the file, but only for some calls (I can see from behaviour that some of the trace functions are being called but not logged).

I really want this to work - debugging ansible is horrible!

(so, for the @q case, I get something like this, which is just a list of all the functions in the module - there is no code path that will actually run them in this order)

0.2s AzureRMEventGridSubscription: 
      <function AzureRMEventGridSubscription.exec_module>
 0.2s AzureRMEventGridSubscription: 
      <function AzureRMEventGridSubscription.get_eventgrid_client>
 0.2s AzureRMEventGridSubscription: 
      <function AzureRMEventGridSubscription.get_subscription>
 0.2s AzureRMEventGridSubscription: 
      <function AzureRMEventGridSubscription.create_update_subscription>
 0.2s AzureRMEventGridSubscription: 
      <function AzureRMEventGridSubscription.delete_subscription>
Read more comments on GitHub >

github_iconTop Results From Across the Web

dir | Microsoft Learn
Reference article for the dir command, which displays a list of a directory's files and subdirectories.
Read more >
Can not delete file named :q · Issue #984 - GitHub
Version info OS: macOS 10.15.7 Build: 2032 or 2038 Description If I have an untracked file named :q in my repo and I...
Read more >
How to delete files/subfolders in a specific directory at the ...
rmdir is my all time favorite command for the job. It works for deleting huge files and folders with subfolders. A backup is...
Read more >
How to Delete Undeletable Files & Folders in Windows 10 or 8 ...
In this video, I will show you how to delete undeletable files on Windows 10, 8 or 7 using command prompt. This tutorial...
Read more >
How can I delete all files/subfolders in a given folder via the ...
You can do this using del and the /S flag (to tell it to remove all files from all subdirectories): del /S C:\Path\to\directory\*....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found