dsccommunity / StorageDsc

DSC resource module is used to manage storage on Windows Servers.
https://dsccommunity.org
MIT License
69 stars 51 forks source link

Disk: Update Size value in example #214

Closed fullenw1 closed 4 years ago

fullenw1 commented 4 years ago

This Pull Request (PR) fixes the following issues

A value with a size unit (like MB or GB) does not work. It generates the following error message:

Compilation errors occurred while processing configuration 'DscConfigurationName'. Please review the errors reported in error stream and modify your configuration code appropriately.

  • CategoryInfo : InvalidOperation: (DscConfiguration:String) [], InvalidOperationException
  • FullyQualifiedErrorId : FailToProcessConfiguration

Entering only a number works fine.

Task list


This change is Reviewable

codecov-io commented 4 years ago

Codecov Report

Merging #214 into dev will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@        Coverage Diff         @@
##           dev   #214   +/-   ##
==================================
  Coverage   95%    95%           
==================================
  Files        7      7           
  Lines      980    980           
==================================
  Hits       939    939           
  Misses      41     41
PlagueHO commented 4 years ago

Hi @fullenw1 - that is really strange. Using 10GB etc should work and passes the example compilation tests. See: https://ci.appveyor.com/project/PowerShell/StorageDsc/branch/dev?fullLog=true#L565

How are you compiling the examples?

fullenw1 commented 4 years ago

Hi @PlagueHO

How are you compiling the examples?

As I got the error message, I spotted by dichotomy the size parameter. My intended value was different but I gave a try to 10GB like in the example (just copied/pasted the value) and got the same error. When I used 10737418240 (the size in bytes), the error message disappeared.

By the way I got the exact same behavior on another resource: https://github.com/PowerShell/ComputerManagementDsc/pull/278

PlagueHO commented 4 years ago

I tried this as well yesterday and you're right - it is failing. Not sure how the Example tests are passing though. That is something I should look into. Anyway, let's proceed with this change.

Can you add an entry into the CHANGELOG.MD for this change?

fullenw1 commented 4 years ago

Can you add an entry into the CHANGELOG.MD for this change?

Done! Please have a look. First time I do this on a DSC module...

PlagueHO commented 4 years ago

Closing because superseded by #218