Giter VIP home page Giter VIP logo

Comments (12)

bpg avatar bpg commented on August 9, 2024 1

Perhaps revert back to 0.46.1

I'll try to publish a fix later tonight.

from terraform-provider-proxmox.

ecanuto avatar ecanuto commented on August 9, 2024 1

@bpg the PR (#1013) updated with new code using two rmdir`s.

from terraform-provider-proxmox.

bpg avatar bpg commented on August 9, 2024 1

v0.46.3 is out and will be available in terraform / opentofu registries soon.

from terraform-provider-proxmox.

euh2 avatar euh2 commented on August 9, 2024

Anyone has an idea how to work around this until this is fixed? I'm trying to get cloud-init integrated. This requires snippets, I think.

from terraform-provider-proxmox.

euh2 avatar euh2 commented on August 9, 2024

Thanks! With 0.46.1 though, I get an issue mentioned in another thread: pvesm path .... So I will just wait for the next release.

from terraform-provider-proxmox.

macklenc avatar macklenc commented on August 9, 2024

Thanks! With 0.46.1 though, I get an issue mentioned in another thread: pvesm path .... So I will just wait for the next release.

Not sure if it will help or not, but I'm not getting any pvesm path errors using the source_raw attribute for the proxmox_virtual_environment_file resource in 0.46.1: #1012

from terraform-provider-proxmox.

ecanuto avatar ecanuto commented on August 9, 2024

Hey, just found another issue with rmdir, the -p:

failed to remove '/tmp': Directory not empty

Looking at the rmdir man page we can see this:

       -p, --parents
              remove DIRECTORY and its ancestors; e.g., 'rmdir -p a/b/c' is similar to
              'rmdir a/b/c a/b a'

``

So, instead of just remove `/tmp/tfpve/.../snippets` it also tries to remove `/tmp`.

The third solution (using rm -rf) can fix the problem but will leave a `/tmp/tfpve/.../`directory behind. 

Searching for a way to properly fix the problem and maybe submit a patch.

from terraform-provider-proxmox.

bpg avatar bpg commented on August 9, 2024

@euh2 Version 0.44.0 is the last one before the sudo changes, you can try that.

from terraform-provider-proxmox.

ecanuto avatar ecanuto commented on August 9, 2024

Looks like the better way to cleanup is to rm -rf on tempFileDir. Let me try to make a pull request.

from terraform-provider-proxmox.

ecanuto avatar ecanuto commented on August 9, 2024

@bpg pull request (#1013) submitted in case you plan to fix it later tonight.

from terraform-provider-proxmox.

bpg avatar bpg commented on August 9, 2024

Thanks, but it would be better to avoid rm -rf. There is a mistake in the code, the file is already moved, we don't need to call rm for it at all, so rmdir will be enough. But it should also have a param to suppress error if dir is not empty.
I can't follow up on this right now, but at some point later today.

from terraform-provider-proxmox.

ecanuto avatar ecanuto commented on August 9, 2024

Thanks, but it would be better to avoid rm -rf. There is a mistake in the code, the file is already moved, we don't need to call rm for it at all, so rmdir will be enough. But it should also have a param to suppress error if dir is not empty. I can't follow up on this right now, but at some point later today.

Theres no parameters to prevent error on rmdir, also, we can't use rmdir -p. The only solution I can see that don't use rm -rf is to use two different rmdir.

			fmt.Sprintf(`%s; try_sudo "mv %s/%s %s/%s" && rmdir %s && rmdir %s`,
				trySudo,
				srcDir, *fileName,
				dstDir, *fileName,
				srcDir,
				tempFileDir,
			),

Going to update PR (#1013).

from terraform-provider-proxmox.

Related Issues (20)

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.