<commit_before>// Copyright 2015 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.

package storageprovisioner

import (
	"path/filepath"

	"github.com/juju/errors"
	"github.com/juju/names"

	"github.com/juju/juju/apiserver/params"
	"github.com/juju/juju/instance"
	"github.com/juju/juju/storage"
)

// filesystemsChanged is called when the lifecycle states of the filesystems
// with the provided IDs have been seen to have changed.
func filesystemsChanged(ctx *context, changes []string) error {
	tags := make([]names.Tag, len(changes))
	for i, change := range changes {
		tags[i] = names.NewFilesystemTag(change)
	}
	alive, dying, dead, err := storageEntityLife(ctx, tags)
	if err != nil {
		return errors.Trace(err)
	}
	logger.Debugf("filesystems alive: %v, dying: %v, dead: %v", alive, dying, dead)
	if len(alive)+len(dying)+len(dead) == 0 {
		return nil
	}

	// Get filesystem information for alive and dead filesystems, so
	// we can provision/deprovision.
	filesystemTags := make([]names.FilesystemTag, 0, len(alive)+len(dying)+len(dead))
	for _, tag := range alive {
		filesystemTags = append(filesystemTags, tag.(names.FilesystemTag))
	}
	for _, tag := range dying {
		filesystemTags = append(filesystemTags, tag.(names.FilesystemTag))<commit_msg>Fix comment<commit_after>// Copyright 2015 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.

package storageprovisioner

import (
	"path/filepath"

	"github.com/juju/errors"
	"github.com/juju/names"

	"github.com/juju/juju/apiserver/params"
	"github.com/juju/juju/instance"
	"github.com/juju/juju/storage"
)

// filesystemsChanged is called when the lifecycle states of the filesystems
// with the provided IDs have been seen to have changed.
func filesystemsChanged(ctx *context, changes []string) error {
	tags := make([]names.Tag, len(changes))
	for i, change := range changes {
		tags[i] = names.NewFilesystemTag(change)
	}
	alive, dying, dead, err := storageEntityLife(ctx, tags)
	if err != nil {
		return errors.Trace(err)
	}
	logger.Debugf("filesystems alive: %v, dying: %v, dead: %v", alive, dying, dead)
	if len(alive)+len(dying)+len(dead) == 0 {
		return nil
	}

	// Get filesystem information for filesystems, so we can provision,
	// deprovision, attach and detach.
	filesystemTags := make([]names.FilesystemTag, 0, len(alive)+len(dying)+len(dead))
	for _, tag := range alive {
		filesystemTags = append(filesystemTags, tag.(names.FilesystemTag))
	}
	for _, tag := range dying {
		filesystemTags = append(filesystemTags, tag.(names.FilesystemTag))
{'fraction_non_alphanumeric': 0.1320607713283989, 'fraction_numerical': 0.005453837164004675, 'mean_word_length': 4.631578947368421, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2480712', 'n_tokens_mistral': 916, 'n_tokens_neox': 856, 'n_words': 231}